linux-kernel-test/drivers/pci
Rafael J. Wysocki 249bfb83cf PCI/PM: Clean up PME state when removing a device
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>
CC: stable@vger.kernel.org
2013-02-13 11:58:02 -07:00
..
hotplug PCI: shpchp: Use per-slot workqueues to avoid deadlock 2013-01-14 10:23:22 -07:00
pcie PCI: remove depends on CONFIG_EXPERIMENTAL 2013-01-17 16:22:05 -07:00
access.c PCI: Add accessors for PCI Express Capability 2012-08-23 09:41:20 -06:00
ats.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-01-11 18:50:26 -08:00
bus.c Merge branch 'pci/mjg-pci-roms-from-efi' into next 2012-12-06 14:37:32 -07:00
host-bridge.c PCI: add host bridge release support 2012-04-30 14:52:43 -06:00
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
htirq.c pci: Fix files needing export.h for EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:22 -04:00
ioapic.c PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
iov.c PCI: Remove useless "!dev" tests 2012-11-09 21:40:09 -07:00
irq.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
Kconfig PCI: Drop bogus default from ARCH_SUPPORTS_MSI 2012-09-10 16:49:52 -06:00
Makefile PCI: Always build setup-bus when PCI is enabled 2012-11-28 13:00:58 -08:00
msi.c s390/pci: PCI adapter interrupts for MSI/MSI-X 2012-11-30 17:47:21 +01:00
msi.h
of.c PCI: OF: Don't crash when bridge parent is NULL. 2011-08-19 08:51:37 -07:00
pci-acpi.c ACPI / PM: Move routines for adding/removing device wakeup notifiers 2012-11-15 00:15:16 +01:00
pci-driver.c PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
pci-label.c switch ->is_visible() to returning umode_t 2012-01-03 22:54:55 -05:00
pci-stub.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
pci-sysfs.c PCI: Remove spurious error for sriov_numvfs store and simplify flow 2012-12-26 10:39:22 -07:00
pci.c PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
pci.h PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
probe.c PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
proc.c PCI/PM: Fix proc config reg access for D3cold and bridge suspending 2012-11-05 10:46:23 -07:00
quirks.c PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz 2012-12-26 10:43:06 -07:00
remove.c PCI/PM: Clean up PME state when removing a device 2013-02-13 11:58:02 -07:00
rom.c PCI: Use phys_addr_t for physical ROM address 2012-12-10 11:24:42 -07:00
search.c Merge branch 'pci/feng-avoid-kmalloc' into next 2012-09-10 16:31:08 -06:00
setup-bus.c PCI: Move out pci_enable_bridges out of assign_unsigned_bus_res 2012-11-03 16:20:30 -06:00
setup-irq.c PCI: Provide a default pcibios_update_irq() 2012-09-18 17:28:21 -06:00
setup-res.c Merge branch 'pci/nikhil-big-bar-fixes' into next 2012-07-18 14:06:20 -06:00
slot.c pci: add module.h to files implicitly relying on its presence. 2011-10-31 19:31:23 -04:00
syscall.c
vpd.c pci: Fix files needing export.h for EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:31:22 -04:00
xen-pcifront.c PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00