File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,9 @@ static int starfive_pcie_probe(struct platform_device *pdev)
404404 if (ret )
405405 return ret ;
406406
407+ pm_runtime_enable (& pdev -> dev );
408+ pm_runtime_get_sync (& pdev -> dev );
409+
407410 plda -> host_ops = & sf_host_ops ;
408411 plda -> num_events = PLDA_MAX_EVENT_NUM ;
409412 /* mask doorbell event */
@@ -413,11 +416,12 @@ static int starfive_pcie_probe(struct platform_device *pdev)
413416 plda -> events_bitmap <<= PLDA_NUM_DMA_EVENTS ;
414417 ret = plda_pcie_host_init (& pcie -> plda , & starfive_pcie_ops ,
415418 & stf_pcie_event );
416- if (ret )
419+ if (ret ) {
420+ pm_runtime_put_sync (& pdev -> dev );
421+ pm_runtime_disable (& pdev -> dev );
417422 return ret ;
423+ }
418424
419- pm_runtime_enable (& pdev -> dev );
420- pm_runtime_get_sync (& pdev -> dev );
421425 platform_set_drvdata (pdev , pcie );
422426
423427 return 0 ;
Original file line number Diff line number Diff line change @@ -3111,6 +3111,17 @@ int pci_host_probe(struct pci_host_bridge *bridge)
31113111 pcie_bus_configure_settings (child );
31123112
31133113 pci_bus_add_devices (bus );
3114+
3115+ /*
3116+ * Ensure pm_runtime_enable() is called for the controller drivers
3117+ * before calling pci_host_probe(). The PM framework expects that
3118+ * if the parent device supports runtime PM, it will be enabled
3119+ * before child runtime PM is enabled.
3120+ */
3121+ pm_runtime_set_active (& bridge -> dev );
3122+ pm_runtime_no_callbacks (& bridge -> dev );
3123+ devm_pm_runtime_enable (& bridge -> dev );
3124+
31143125 return 0 ;
31153126}
31163127EXPORT_SYMBOL_GPL (pci_host_probe );
You can’t perform that action at this time.
0 commit comments