Here's version two of this, and is even more aggressive than before about reducing access that we know will end in failure. The first two patches are new. It attempts to completely remove config space access on removed devices. Patch 1/4 adds a new state to pci_dev called "is_removed" that's set when the device is detected to be inaccessible. Patch 2/4 returns immediately from any config space access request on devices in such a state so we don't rely on hardware to handle this. I dropped the patch to abort searching pcie extended capabilities. Caching the AER capability obviates any immediate need for that. Patch 3/4 moves the cached aer_cap from the aer driver's private structure to the pci_dev structure so all devices in the sub-tree know about this capability postition. Patch 4/4 is still skipping disabling MSI-x when removed, and I added a new check prior to writing any MSI messages as well. The criteria being checked is the new "is_removed" state rather than verifying the VID/DID is valid, which potentially just introduces additional config space access. This series reduces the number of non-functional MMIO and config space accesses on a hot removed device from ~1000 commands to ~1, improving software's time to teardown surprise removed devices. Keith Busch (4): pci: Add is_removed state pci: No config access for removed devices pcie/aer: Cache capability position pci/msix: Skip disabling removed devices drivers/pci/hotplug/pciehp_pci.c | 2 ++ drivers/pci/msi.c | 7 ++++++- drivers/pci/pci.c | 9 ++++++++- drivers/pci/pcie/aer/aerdrv.c | 10 +++++----- drivers/pci/pcie/aer/aerdrv_core.c | 12 ++++++------ drivers/pci/pcie/pcie-dpc.c | 1 + drivers/pci/probe.c | 2 ++ include/linux/pci.h | 20 ++++++++++++++++++++ 8 files changed, 50 insertions(+), 13 deletions(-) -- 2.7.2 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html