Patchwork [RFC,v3,07/21] PCI: Wake up bridges during rescan when movable BARs enabled

login
register
mail settings
Submitter Sergey Miroshnichenko
Date Feb. 4, 2019, 3:35 p.m.
Message ID <20190204153601.7576-8-s.miroshnichenko@yadro.com>
Download mbox | patch
Permalink /patch/717453/
State New
Headers show

Comments

Sergey Miroshnichenko - Feb. 4, 2019, 3:35 p.m.
Use the PM runtime methods to wake up the bridges before accessing
their config space.

Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko@yadro.com>
---
 drivers/pci/probe.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index e18d07996cf3..7fe68b4f04bf 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3176,6 +3176,8 @@  static void pci_bus_rescan_prepare(struct pci_bus *bus)
 {
 	struct pci_dev *dev;
 
+	pm_runtime_get_sync(&bus->dev);
+
 	list_for_each_entry(dev, &bus->devices, bus_list) {
 		struct pci_bus *child = dev->subordinate;
 
@@ -3202,6 +3204,8 @@  static void pci_bus_rescan_done(struct pci_bus *bus)
 			dev->driver->rescan_done(dev);
 		}
 	}
+
+	pm_runtime_put(&bus->dev);
 }
 
 /**