[linux-yocto] [PATCH 6/7] ACPI / hotplug / PCI: Runtime resume bridge before rescan

Yong, Jonathan jonathan.yong at intel.com
Wed Jun 29 18:03:22 PDT 2016


From: Mika Westerberg <mika.westerberg at linux.intel.com>

If a PCI bridge (or PCIe port) that is runtime suspended gets an ACPI
hotplug event, such as BUS_CHECK we need to make sure it is resumed before
devices below the bridge are re-scanned. Otherwise the devices behind the
port are not accessible and will be treated as hot-unplugged.

To fix this, resume PCI bridges from runtime suspend while rescanning.

Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Signed-off-by: Yong, Jonathan <jonathan.yong at intel.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index b60309e..d49f481 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -676,6 +676,8 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
 	if (bridge->is_going_away)
 		return;
 
+	pm_runtime_get_sync(&bridge->pci_dev->dev);
+
 	list_for_each_entry(slot, &bridge->slots, node) {
 		struct pci_bus *bus = slot->bus;
 		struct pci_dev *dev, *tmp;
@@ -695,6 +697,8 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
 			disable_slot(slot);
 		}
 	}
+
+	pm_runtime_put(&bridge->pci_dev->dev);
 }
 
 /*
-- 
2.7.3



More information about the linux-yocto mailing list