linux/drivers/pci
Thomas Gleixner 3f35d2cf9f PCI/MSI: Decouple MSI[-X] disable from pcim_release()
The MSI core will introduce runtime allocation of MSI related data. This
data will be devres managed and has to be set up before enabling
PCI/MSI[-X]. This would introduce an ordering issue vs. pcim_release().

The setup order is:

   pcim_enable_device()
	devres_alloc(pcim_release...);
	...
	pci_irq_alloc()
	  msi_setup_device_data()
	     devres_alloc(msi_device_data_release, ...)

and once the device is released these release functions are invoked in the
opposite order:

    msi_device_data_release()
    ...
    pcim_release()
       pci_disable_msi[x]()

which is obviously wrong, because pci_disable_msi[x]() requires the MSI
data to be available to tear down the MSI[-X] interrupts.

Remove the MSI[-X] teardown from pcim_release() and add an explicit action
to be installed on the attempt of enabling PCI/MSI[-X].

This allows the MSI core data allocation to be ordered correctly in a
subsequent step.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/87tuf9rdoj.ffs@tglx
2021-12-16 22:16:38 +01:00
..
controller pci-v5.16-fixes-2 2021-12-10 11:56:05 -08:00
endpoint Merge branch 'remotes/lorenzo/pci/endpoint' 2021-11-05 11:28:50 -05:00
hotplug s390/pci: implement reset_slot for hotplug slot 2021-11-08 14:17:49 +01:00
msi PCI/MSI: Decouple MSI[-X] disable from pcim_release() 2021-12-16 22:16:38 +01:00
pcie Revert "PCI: Use to_pci_driver() instead of pci_dev->driver" 2021-11-11 13:36:22 -06:00
switch PCI/switchtec: Add check of event support 2021-10-14 09:22:47 -05:00
access.c
ats.c PCI: Allow PASID on fake PCIe devices without TLP prefixes 2021-08-26 14:21:42 -05:00
bus.c
ecam.c PCI: Dynamically map ECAM regions 2021-06-16 17:20:40 -05:00
host-bridge.c PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus 2021-09-02 17:59:58 +02:00
iov.c Revert "PCI: Use to_pci_driver() instead of pci_dev->driver" 2021-11-11 13:36:22 -06:00
irq.c
Kconfig PCI: only build xen-pcifront in PV-enabled environments 2021-09-20 17:01:11 +02:00
Makefile PCI/MSI: Move code into a separate directory 2021-12-09 11:52:22 +01:00
mmap.c
of.c PCI: of: Allow matching of an interrupt-map local to a PCI device 2021-11-04 14:16:56 -05:00
p2pdma.c Merge branch 'pci/sysfs' 2021-11-05 11:28:46 -05:00
pci-acpi.c Merge branch 'pm-pci' 2021-11-02 19:06:30 +01:00
pci-bridge-emul.c PCI: pci-bridge-emul: Fix emulation of W1C bits 2021-10-29 10:25:31 +01:00
pci-bridge-emul.h PCI: pci-bridge-emul: Add PCIe Root Capabilities Register 2021-08-05 10:51:49 +01:00
pci-driver.c Revert "PCI: Use to_pci_driver() instead of pci_dev->driver" 2021-11-11 13:36:22 -06:00
pci-label.c PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions 2021-06-03 22:14:47 -05:00
pci-mid.c PCI: PM: Do not use pci_platform_pm_ops for Intel MID PM 2021-09-27 17:13:21 +02:00
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Use pci_irq_vector() 2021-12-09 11:52:21 +01:00
pci.c PCI/MSI: Decouple MSI[-X] disable from pcim_release() 2021-12-16 22:16:38 +01:00
pci.h pci-v5.16-changes 2021-11-06 14:36:12 -07:00
probe.c PCI/MSI: Move msi_lock to struct pci_dev 2021-12-09 11:52:22 +01:00
proc.c pci-v5.15-changes 2021-09-07 19:13:42 -07:00
quirks.c PCI: Add MSI masking quirk for Nvidia ION AHCI 2021-11-11 09:50:31 +01:00
remove.c PCI: Remove reset_fn field from pci_dev 2021-08-17 17:44:38 -05:00
rom.c PCI: Prefer 'unsigned int' over bare 'unsigned' 2021-10-27 13:41:22 -05:00
search.c PCI: Remove WARN_ON(in_interrupt()) 2021-02-10 16:46:29 -06:00
setup-bus.c PCI: Prefer 'unsigned int' over bare 'unsigned' 2021-10-27 13:41:22 -05:00
setup-irq.c PCI: Tidy comments 2021-09-28 13:43:17 -05:00
setup-res.c PCI: Decline to resize resources if boot config must be preserved 2021-01-12 16:39:52 -06:00
slot.c PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions 2021-06-03 22:14:47 -05:00
syscall.c PCI: Return int from pciconfig_read() syscall 2021-08-03 16:55:48 -05:00
vc.c
vpd.c PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size() 2021-10-25 19:12:23 -05:00
xen-pcifront.c genirq/msi, treewide: Use a named struct for PCI/MSI attributes 2021-12-09 11:52:21 +01:00