This is a note to let you know that I've just added the patch titled PCI: hv: Fix a crash in hv_pci_restore_msi_msg() during hibernation to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pci-hv-fix-a-crash-in-hv_pci_restore_msi_msg-during-hibernation.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 04bbe863241a9be7d57fb4cf217ee4a72f480e70 Mon Sep 17 00:00:00 2001 From: Dexuan Cui <decui@xxxxxxxxxxxxx> Date: Wed, 16 Aug 2023 10:59:39 -0700 Subject: PCI: hv: Fix a crash in hv_pci_restore_msi_msg() during hibernation From: Dexuan Cui <decui@xxxxxxxxxxxxx> commit 04bbe863241a9be7d57fb4cf217ee4a72f480e70 upstream. When a Linux VM with an assigned PCI device runs on Hyper-V, if the PCI device driver is not loaded yet (i.e. MSI-X/MSI is not enabled on the device yet), doing a VM hibernation triggers a panic in hv_pci_restore_msi_msg() -> msi_lock_descs(&pdev->dev), because pdev->dev.msi.data is still NULL. Avoid the panic by checking if MSI-X/MSI is enabled. Link: https://lore.kernel.org/r/20230816175939.21566-1-decui@xxxxxxxxxxxxx Fixes: dc2b453290c4 ("PCI: hv: Rework MSI handling") Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx> Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx> Reviewed-by: sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/pci/controller/pci-hyperv.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3983,6 +3983,9 @@ static int hv_pci_restore_msi_msg(struct struct msi_desc *entry; int ret = 0; + if (!pdev->msi_enabled && !pdev->msix_enabled) + return 0; + msi_lock_descs(&pdev->dev); msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) { irq_data = irq_get_irq_data(entry->irq); Patches currently in stable-queue which might be from decui@xxxxxxxxxxxxx are queue-6.4/pci-hv-fix-a-crash-in-hv_pci_restore_msi_msg-during-hibernation.patch