Skip to content

Commit 6168efb

Browse files
Mayank Ranabjorn-helgaas
authored andcommitted
PCI: starfive: Enable controller runtime PM before probing host bridge
A PCI controller device, e.g., StarFive, is parent to PCI host bridge device. We must enable runtime PM of the controller before enabling runtime PM of the host bridge, which will happen in pci_host_probe(), to avoid this warning: pcie-starfive 940000000.pcie: Enabling runtime PM for inactive device with active children Fix this issue by enabling StarFive controller device's runtime PM before calling pci_host_probe() in plda_pcie_host_init(). Link: https://lore.kernel.org/r/20241111-runtime_pm-v7-1-9c164eefcd87@quicinc.com Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mayank Rana <quic_mrana@quicinc.com> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 9852d85 commit 6168efb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pci/controller/plda/pcie-starfive.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)