Skip to content

Commit b182cba

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
PCI/MSI: Use never-managed version of pci_intx()
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/[email protected]/ Replace the call to pci_intx() with one to the never-managed version pci_intx_unmanaged(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]>
1 parent bf72697 commit b182cba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/pci/msi/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
289289
*/
290290
if (affd)
291291
irq_create_affinity_masks(1, affd);
292-
pci_intx(dev, 1);
292+
pci_intx_unmanaged(dev, 1);
293293
return 1;
294294
}
295295
}

drivers/pci/msi/msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg);
268268
static void pci_intx_for_msi(struct pci_dev *dev, int enable)
269269
{
270270
if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG))
271-
pci_intx(dev, enable);
271+
pci_intx_unmanaged(dev, enable);
272272
}
273273

274274
static void pci_msi_set_enable(struct pci_dev *dev, int enable)

0 commit comments

Comments
 (0)