From: Mika Westerberg Date: Tue, 29 May 2018 16:02:23 +0000 (+0300) Subject: ACPI / hotplug / PCI: Mark stale PCI devices disconnected X-Git-Tag: v4.19~864^2~19^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f004f4a34fd129622567cbec381101cc5ff7f09;p=platform%2Fkernel%2Flinux-rpi3.git ACPI / hotplug / PCI: Mark stale PCI devices disconnected Following PCIehp mark the unplugged PCI devices disconnected. This makes sure PCI core code leaves the now missing hardware registers alone. Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko --- diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index bc9e196..b526565 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -649,6 +649,11 @@ static void trim_stale_devices(struct pci_dev *dev) alive = pci_device_is_present(dev); if (!alive) { + pci_dev_set_disconnected(dev, NULL); + if (pci_has_subordinate(dev)) + pci_walk_bus(dev->subordinate, pci_dev_set_disconnected, + NULL); + pci_stop_and_remove_bus_device(dev); if (adev) acpi_bus_trim(adev);