Message ID | 20241111-runtime_pm-v7-2-9c164eefcd87@quicinc.com (mailing list archive) |
---|---|
State | Accepted |
Commit | dc421bb3c0db2aac926b548d259d3b550394908e |
Headers | show |
Series | PCI: Enable runtime pm of the host bridge | expand |
… > PM framework expectes parent runtime pm enabled before enabling runtime expects? PM? > pm of the child. … PM? > drivers, before calling pci_host_probe() as pm frameworks expects if the PM framework? > parent device supports runtime pm then it needs to enabled before child PM? > runtime pm. PM? Can any tags (like “Fixes” and “Cc”) become helpful for the proposed change? Regards, Markus
On 11/11/2024 10:16 PM, Markus Elfring wrote: > … >> PM framework expectes parent runtime pm enabled before enabling runtime > > expects? PM? > > >> pm of the child. … > > PM? > > >> drivers, before calling pci_host_probe() as pm frameworks expects if the > > PM framework? > > >> parent device supports runtime pm then it needs to enabled before child > > PM? > > >> runtime pm. > > PM? > > > Can any tags (like “Fixes” and “Cc”) become helpful for the proposed change? Bjorn, This problem was present from starting on wards not sure what is the fix tag we need to use here, is it fine if we use fix tag as below. as at this function only we are trying add the fix. Fixes: 49b8e3f3ed1d4 ("PCI: Add generic function to probe PCI host controllers") - Krishna Chaitanya. > > Regards, > Markus
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4f68414c3086..ee30e6024f52 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3106,6 +3106,17 @@ int pci_host_probe(struct pci_host_bridge *bridge) pcie_bus_configure_settings(child); pci_bus_add_devices(bus); + + /* + * Ensure pm_runtime_enable() is called for the controller drivers, + * before calling pci_host_probe() as pm frameworks expects if the + * parent device supports runtime pm then it needs to enabled before + * child runtime pm. + */ + pm_runtime_set_active(&bridge->dev); + pm_runtime_no_callbacks(&bridge->dev); + devm_pm_runtime_enable(&bridge->dev); + return 0; } EXPORT_SYMBOL_GPL(pci_host_probe);