[RFC,v2,20/21] PCI: Wake up bridges during rescan when movable BARs enabled
diff mbox series

Message ID 20190111153707.10140-21-s.miroshnichenko@yadro.com
State New
Headers show
Series
  • PCI: Allow BAR movement during hotplug
Related show

Commit Message

Sergey Miroshnichenko Jan. 11, 2019, 3:37 p.m. UTC
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 mbox series

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4726049a19ad..a80978906ac3 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3199,6 +3199,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;
 
@@ -3242,6 +3244,8 @@  static void pci_bus_rescan_done(struct pci_bus *bus)
 			dev->driver->rescan_done(dev);
 		}
 	}
+
+	pm_runtime_put(&bus->dev);
 }
 
 static void pci_setup_bridges(struct pci_bus *bus)