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)
404
404
if (ret )
405
405
return ret ;
406
406
407
+ pm_runtime_enable (& pdev -> dev );
408
+ pm_runtime_get_sync (& pdev -> dev );
409
+
407
410
plda -> host_ops = & sf_host_ops ;
408
411
plda -> num_events = PLDA_MAX_EVENT_NUM ;
409
412
/* mask doorbell event */
@@ -413,11 +416,12 @@ static int starfive_pcie_probe(struct platform_device *pdev)
413
416
plda -> events_bitmap <<= PLDA_NUM_DMA_EVENTS ;
414
417
ret = plda_pcie_host_init (& pcie -> plda , & starfive_pcie_ops ,
415
418
& stf_pcie_event );
416
- if (ret )
419
+ if (ret ) {
420
+ pm_runtime_put_sync (& pdev -> dev );
421
+ pm_runtime_disable (& pdev -> dev );
417
422
return ret ;
423
+ }
418
424
419
- pm_runtime_enable (& pdev -> dev );
420
- pm_runtime_get_sync (& pdev -> dev );
421
425
platform_set_drvdata (pdev , pcie );
422
426
423
427
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)
3111
3111
pcie_bus_configure_settings (child );
3112
3112
3113
3113
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
+
3114
3125
return 0 ;
3115
3126
}
3116
3127
EXPORT_SYMBOL_GPL (pci_host_probe );
You can’t perform that action at this time.
0 commit comments