PCI: qcom: fix probe error paths
Subsystems (5)
cover PCI: qcom: fix probe error paths
This series fixes a few problems in the probe error handling which could cause trouble, for example, on probe deferral.
Johan
Johan Hovold (2):
PCI: qcom: fix runtime PM imbalance on probe errors
PCI: qcom: fix unbalanced phy init on probe errors
drivers/pci/controller/dwc/pcie-qcom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/2 PCI: qcom: fix runtime PM imbalance on probe errors
Drop the leftover pm_runtime_disable() calls from the late probe error paths that would, for example, prevent runtime PM from being reenabled after a probe deferral.
--- drivers/pci/controller/dwc/pcie-qcom.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +1 -4
@@ -1616,17 +1616,14 @@ static int qcom_pcie_probe(struct platform_device *pdev) pp->ops = &qcom_pcie_dw_ops; ret =phy_init (pcie->phy); -if (ret) { -pm_runtime_disable (&pdev->dev); +if (ret) goto err_pm_runtime_put; - }platform_set_drvdata (pdev, pcie); ret =dw_pcie_host_init (pp);if (ret) {dev_err (dev,"cannot initialize host\n" ); -pm_runtime_disable (&pdev->dev); goto err_pm_runtime_put; }
Signature · 1 line
2.35.1
PATCH 2/2 PCI: qcom: fix unbalanced phy init on probe errors
In reply to Johan HovoldMake sure to undo the PHY initialisation (e.g. balance runtime PM) in case host initialisation fails during probe.
--- drivers/pci/controller/dwc/pcie-qcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +3 -1
@@ -1624,11 +1624,13 @@ static int qcom_pcie_probe(struct platform_device *pdev) ret =dw_pcie_host_init (pp);if (ret) {dev_err (dev,"cannot initialize host\n" ); - goto err_pm_runtime_put; + goto err_phy_exit; }return 0 ; +err_phy_exit: +phy_exit (pcie->phy); err_pm_runtime_put:pm_runtime_put (dev);pm_runtime_disable (dev);
Signature · 1 line
2.35.1
Re: [PATCH 2/2] PCI: qcom: fix unbalanced phy init on probe errors
In subject, capitalize "Fix" and "PHY" to match previous commits and your commit log. Same for other patch.
Quoted 33 lines · Johan Hovold
Make sure to undo the PHY initialisation (e.g. balance runtime PM) in case host initialisation fails during probe.
Fixes 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver")Cc [email protected] # 4.5Cc Stanimir Varbanov <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/pci/controller/dwc/pcie-qcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/controller/dwc/pcie-qcom.c +3
-1@@ -1624,11 +1624,13 @@ static int qcom_pcie_probe(struct platform_device *pdev) ret =dw_pcie_host_init (pp);if (ret) {dev_err (dev,"cannot initialize host\n" ); - goto err_pm_runtime_put; + goto err_phy_exit; }return 0 ; +err_phy_exit: +phy_exit (pcie->phy); err_pm_runtime_put:pm_runtime_put (dev);pm_runtime_disable (dev);Signature · 1 line
2.35.1