PCI: qcom: Fix probe error paths
Subsystems (5)
v2 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
Changes in v2
- Capitalise subject lines according to PCI subsystem conventions
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 v2 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
Re: [PATCH v2 1/2] PCI: qcom: Fix runtime PM imbalance on probe errors
Quoted 8 lines · Johan Hovold
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.Fixes 6e5da6f7d824 ("PCI: qcom: Fix error handling in runtime PM support")Cc [email protected] # 4.20Cc Bjorn Andersson <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Thanks,
Mani
Quoted 30 lines
--- 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 v2 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 v2 2/2] PCI: qcom: Fix unbalanced PHY init on probe errors
Quoted 7 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]>
Thanks,
Mani
Quoted 26 lines
--- 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
Quoted 9 lines · Johan Hovold
This series fixes a few problems in the probe error handling which could cause trouble, for example, on probe deferral.
Johan Hovold (2):
PCI: qcom: Fix runtime PM imbalance on probe errors
PCI: qcom: Fix unbalanced PHY init on probe errorsdrivers/pci/controller/dwc/pcie-qcom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Any comments to this series? Does it need a Qualcomm maintainer ack to be merged? Bjorn?
Johan
Hi Johan,
Quoted 10 lines · Johan Hovold
This series fixes a few problems in the probe error handling which could cause trouble, for example, on probe deferral.
Johan
Changes in v2
- Capitalise subject lines according to PCI subsystem conventions
Quoted 7 lines
Johan Hovold (2):
PCI: qcom: Fix runtime PM imbalance on probe errors
PCI: qcom: Fix unbalanced PHY init on probe errorsdrivers/pci/controller/dwc/pcie-qcom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Signature · 2 lines
regards, Stan
Lorenzo Pieralisi
AppliedQuoted 10 lines · Johan Hovold
This series fixes a few problems in the probe error handling which could cause trouble, for example, on probe deferral.
Johan
Changes in v2
- Capitalise subject lines according to PCI subsystem conventions[...]
Applied to pci/qcom, thanks!
[1/2] PCI: qcom: Fix runtime PM imbalance on probe errors
https://git.kernel.org/lpieralisi/pci/c/b986db29ed [2/2] PCI: qcom: Fix unbalanced PHY init on probe errors https://git.kernel.org/lpieralisi/pci/c/3ae93c5a97
Thanks,
Lorenzo