lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun,  5 Jul 2020 14:47:58 +0530
From:   Sivaprakash Murugesan <sivaprak@...eaurora.org>
To:     agross@...nel.org, bjorn.andersson@...aro.org, bhelgaas@...gle.com,
        robh+dt@...nel.org, kishon@...com, vkoul@...nel.org,
        mturquette@...libre.com, sboyd@...nel.org, svarbanov@...sol.com,
        lorenzo.pieralisi@....com, p.zabel@...gutronix.de,
        sivaprak@...eaurora.org, mgautam@...eaurora.org,
        smuthayy@...eaurora.org, varada@...eaurora.org,
        linux-arm-msm@...r.kernel.org, linux-pci@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-clk@...r.kernel.org
Cc:     Selvam Sathappan Periakaruppan <speriaka@...eaurora.org>
Subject: [PATCH 7/9] pci: dwc: qcom: do phy power on before pcie init

Commit cc1e06f033af ("phy: qcom: qmp: Use power_on/off ops for PCIe")
changed phy ops from init/deinit to power on/off, due to this phy enable
is getting called after pcie init.

On some platforms like ipq8074 phy should be inited before accessing the
pcie register space, otherwise the system would hang.

So move phy_power_on API before pcie init API.

Fixes: commit cc1e06f033af ("phy: qcom: qmp: Use power_on/off ops for PCIe")
Co-developed-by: Selvam Sathappan Periakaruppan <speriaka@...eaurora.org>
Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@...eaurora.org>
Signed-off-by: Sivaprakash Murugesan <sivaprak@...eaurora.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 138e1a2d21cc..aa52a2124760 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1222,18 +1222,18 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
 
 	qcom_ep_reset_assert(pcie);
 
-	ret = pcie->ops->init(pcie);
+	ret = phy_power_on(pcie->phy);
 	if (ret)
 		return ret;
 
-	ret = phy_power_on(pcie->phy);
+	ret = pcie->ops->init(pcie);
 	if (ret)
-		goto err_deinit;
+		goto err_disable_phy;
 
 	if (pcie->ops->post_init) {
 		ret = pcie->ops->post_init(pcie);
 		if (ret)
-			goto err_disable_phy;
+			goto err_deinit;
 	}
 
 	dw_pcie_setup_rc(pp);
@@ -1252,10 +1252,10 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
 	qcom_ep_reset_assert(pcie);
 	if (pcie->ops->post_deinit)
 		pcie->ops->post_deinit(pcie);
-err_disable_phy:
-	phy_power_off(pcie->phy);
 err_deinit:
 	pcie->ops->deinit(pcie);
+err_disable_phy:
+	phy_power_off(pcie->phy);
 
 	return ret;
 }
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ