linux-uconsole/drivers/pci
Rafael J. Wysocki e862f5583a PCI/PM: Clean up PME state when removing a device
commit 249bfb83cf upstream.

Devices are added to pci_pme_list when drivers use pci_enable_wake()
or pci_wake_from_d3(), but they aren't removed from the list unless
the driver explicitly disables wakeup.  Many drivers never disable
wakeup, so their devices remain on the list even after they are
removed, e.g., via hotplug.  A subsequent PME poll will oops when
it tries to touch the device.

This patch disables PME# on a device before removing it, which removes
the device from pci_pme_list.  This is safe even if the device never
had PME# enabled.

This oops can be triggered by unplugging a Thunderbolt ethernet adapter
on a Macbook Pro, as reported by Daniel below.

[bhelgaas: changelog]
Reference: http://lkml.kernel.org/r/CAMVG2svG21yiM1wkH4_2pen2n+cr2-Zv7TbH3Gj+8MwevZjDbw@mail.gmail.com
Reported-and-tested-by: Daniel J Blueman <daniel@quora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-17 10:46:20 -08:00
..
hotplug PCI: acpiphp: check whether _ADR evaluation succeeded 2012-10-13 05:28:03 +09:00
pcie PCI: Allow pcie_aspm=force even when FADT indicates it is unsupported 2013-01-27 20:46:28 -08:00
.gitignore
access.c PCI: handle positive error codes 2011-05-10 15:43:36 -07:00
bus.c PCI/sysfs: move bus cpuaffinity to class dev_attrs 2011-05-21 12:17:13 -07:00
dmar.c x86, iommu: Mark DMAR IRQ as non-threaded 2011-10-03 11:40:29 -07:00
hotplug-pci.c
hotplug.c
htirq.c drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
intel-iommu.c intel-iommu: Prevent devices with RMRRs from being placed into SI Domain 2013-01-21 11:44:59 -08:00
intr_remapping.c Fix common misspellings 2011-03-31 11:26:23 -03:00
intr_remapping.h
ioapic.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
iov.c PCI: Move ATS declarations in seperate header file 2011-04-11 09:01:41 +02:00
iova.c intel-iommu: Dont cache iova above 32bit 2011-06-01 12:47:40 +01:00
irq.c
Kconfig PCI: pci-label: Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig 2011-04-12 08:39:02 -07:00
Makefile sparc32,leon: added LEON-common low-level PCI routines 2011-06-02 14:32:37 -07:00
msi.c PCI: msi: Disable msi interrupts when we initialize a pci device 2012-01-25 17:24:38 -08:00
msi.h PCI: MSI: Move MSI-X entry definition to pci_regs.h 2010-12-23 12:53:07 -08:00
pci-acpi.c PCI: Rework ASPM disable code 2012-02-06 09:24:01 -08:00
pci-driver.c PCI: EHCI: Fix crash during hibernation on ASUS computers 2012-09-14 10:00:39 -07:00
pci-label.c PCI: label: remove #include of ACPI header to avoid warnings 2011-03-16 10:24:34 -07:00
pci-stub.c PCI: pci-stub: ignore zero-length id parameters 2010-12-23 12:53:52 -08:00
pci-sysfs.c PCI/sysfs: move bus cpuaffinity to class dev_attrs 2011-05-21 12:17:13 -07:00
pci.c PCI: EHCI: fix crash during suspend on ASUS computers 2012-07-16 08:47:50 -07:00
pci.h PCI: conditional resource-reallocation through kernel parameter pci=realloc 2011-07-08 15:49:20 -07:00
probe.c PCI: Check P2P bridge for invalid secondary/subordinate range 2012-10-13 05:28:09 +09:00
proc.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
quirks.c PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz 2013-01-11 09:03:49 -08:00
remove.c PCI/PM: Clean up PME state when removing a device 2013-02-17 10:46:20 -08:00
rom.c
search.c PCI: use for_each_pci_dev() 2010-07-30 09:47:22 -07:00
setup-bus.c PCI : Calculate right add_size 2012-11-26 11:34:57 -08:00
setup-irq.c PCI: use for_each_pci_dev() 2010-07-30 09:47:22 -07:00
setup-res.c PCI : Calculate right add_size 2012-11-26 11:34:57 -08:00
slot.c PCI: bus speed strings should be const 2010-08-31 15:28:00 -07:00
syscall.c
vpd.c pci: Add helper to search for VPD keywords 2010-02-28 00:43:33 -08:00
xen-pcifront.c xen-pcifront: Update warning comment to use 'e820_host' option. 2011-11-11 09:35:46 -08:00