summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2022-04-01 15:38:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-14 16:52:41 +0200
commitfaebc1a270273898199dfe209f387293a8d39eb5 (patch)
tree9599e41711e6de2904da517a01479d0eb73a307c
parent6630c79930c3139f0fd3435a09442dccd8f8d10f (diff)
PCI: qcom: Fix unbalanced PHY init on probe errors
commit 83013631f0f9961416abd812e228c8efbc2f6069 upstream. Undo the PHY initialisation (e.g. balance runtime PM) if host initialisation fails during probe. Link: https://lore.kernel.org/r/20220401133854.10421-3-johan+linaro@kernel.org Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com> Cc: stable@vger.kernel.org # 4.5 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/pci/host/pcie-qcom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/host/pcie-qcom.c b/drivers/pci/host/pcie-qcom.c
index 35936409b2d4..f5f9828f96bf 100644
--- a/drivers/pci/host/pcie-qcom.c
+++ b/drivers/pci/host/pcie-qcom.c
@@ -562,10 +562,15 @@ static int qcom_pcie_probe(struct platform_device *pdev)
ret = dw_pcie_host_init(pp);
if (ret) {
dev_err(dev, "cannot initialize host\n");
- return ret;
+ goto err_phy_exit;
}
return 0;
+
+err_phy_exit:
+ phy_exit(pcie->phy);
+
+ return ret;
}
static const struct of_device_id qcom_pcie_match[] = {