]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
PCI/MSI: Use never-managed version of pci_intx()
authorPhilipp Stanner <pstanner@redhat.com>
Mon, 9 Dec 2024 13:06:29 +0000 (14:06 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 18 Jan 2025 20:38:48 +0000 (14:38 -0600)
pci_intx() is a hybrid function which can sometimes be managed through
devres. To remove this hybrid nature from pci_intx(), it is necessary to
port users to either an always-managed or a never-managed version.

MSI sets up its own separate devres callback implicitly in
pcim_setup_msi_release(). This callback ultimately uses pci_intx(), which
is problematic since the callback runs on driver detach.

That problem has last been described here:
https://lore.kernel.org/all/ee44ea7ac760e73edad3f20b30b4d2fff66c1a85.camel@redhat.com/

Replace the call to pci_intx() with one to the never-managed version
pci_intx_unmanaged().

Link: https://lore.kernel.org/r/20241209130632.132074-9-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
drivers/pci/msi/api.c
drivers/pci/msi/msi.c

index b956ce591f964b41a7cac5e563dc7a2747026907..c95e2e7dc9ab4c1cf4dd788d39ea45db2eef9d52 100644 (file)
@@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
                         */
                        if (affd)
                                irq_create_affinity_masks(1, affd);
-                       pci_intx(dev, 1);
+                       pci_intx_unmanaged(dev, 1);
                        return 1;
                }
        }
index 3a45879d85db9613d112b6d888d3e9211cbcb705..53f13b09db500e039f5fac5d9a158eac77adfc32 100644 (file)
@@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg);
 static void pci_intx_for_msi(struct pci_dev *dev, int enable)
 {
        if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG))
-               pci_intx(dev, enable);
+               pci_intx_unmanaged(dev, enable);
 }
 
 static void pci_msi_set_enable(struct pci_dev *dev, int enable)