public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: qcom-ep: Do not enable resources during probe()
@ 2024-07-27  9:06 Manivannan Sadhasivam
  2024-07-27 10:32 ` Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-27  9:06 UTC (permalink / raw)
  To: lpieralisi, kw
  Cc: robh, bhelgaas, linux-arm-msm, linux-pci, linux-kernel,
	Manivannan Sadhasivam

Starting from commit 869bc5253406 ("PCI: dwc: ep: Fix DBI access failure
for drivers requiring refclk from host"), all the hardware register access
(like DBI) were moved to dw_pcie_ep_init_registers() which gets called only
in qcom_pcie_perst_deassert() i.e., only after the endpoint received refclk
from host.

So there is no need to enable the endpoint resources (like clk, regulators,
PHY) during probe(). Hence, remove the call to qcom_pcie_enable_resources()
helper from probe(). This was added earlier because dw_pcie_ep_init() was
doing DBI access, which is not done now.

While at it, let's also call dw_pcie_ep_deinit() in err path to deinit the
EP controller in the case of failure.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 236229f66c80..2319ff2ae9f6 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -846,21 +846,15 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = qcom_pcie_enable_resources(pcie_ep);
-	if (ret) {
-		dev_err(dev, "Failed to enable resources: %d\n", ret);
-		return ret;
-	}
-
 	ret = dw_pcie_ep_init(&pcie_ep->pci.ep);
 	if (ret) {
 		dev_err(dev, "Failed to initialize endpoint: %d\n", ret);
-		goto err_disable_resources;
+		return ret;
 	}
 
 	ret = qcom_pcie_ep_enable_irq_resources(pdev, pcie_ep);
 	if (ret)
-		goto err_disable_resources;
+		goto err_ep_deinit;
 
 	name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
 	if (!name) {
@@ -877,8 +871,8 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 	disable_irq(pcie_ep->global_irq);
 	disable_irq(pcie_ep->perst_irq);
 
-err_disable_resources:
-	qcom_pcie_disable_resources(pcie_ep);
+err_ep_deinit:
+	dw_pcie_ep_deinit(&pcie_ep->pci.ep);
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-09-01 16:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-27  9:06 [PATCH] PCI: qcom-ep: Do not enable resources during probe() Manivannan Sadhasivam
2024-07-27 10:32 ` Dmitry Baryshkov
2024-08-13 17:02   ` Manivannan Sadhasivam
2024-08-13 20:27     ` Krzysztof Wilczyński
2024-08-13 20:25 ` Krzysztof Wilczyński
2024-08-21 22:56   ` Bjorn Helgaas
2024-08-22  6:48     ` Manivannan Sadhasivam
2024-08-22 15:16       ` Bjorn Helgaas
2024-08-22 15:40         ` Manivannan Sadhasivam
2024-08-22 17:31           ` Bjorn Helgaas
2024-08-23  4:41             ` Manivannan Sadhasivam
2024-08-23 22:04               ` Bjorn Helgaas
2024-08-24  2:19                 ` Manivannan Sadhasivam
2024-08-24 16:12                   ` Bjorn Helgaas
2024-08-24 16:34                     ` Manivannan Sadhasivam
2024-09-01 16:34   ` Krzysztof Wilczyński
2024-08-15 18:15 ` Bjorn Helgaas
2024-08-16  5:37   ` Manivannan Sadhasivam
2024-08-16 12:02     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox