Skip to contentSkip to conversation

PCI: qcom: use PHY_REFCLK_USE_PAD only for ipq8064

PATCH RESEND Applied Ansuel Smith 4 participants 5 messages Oct 19, 2020 – Mar 1, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 PCI: qcom: use PHY_REFCLK_USE_PAD only for ipq8064

The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. It was tested that while apq doesn't require the padding, ipq SoC must use it or the kernel hangs on boot.

Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev 2.1.0")
Cc [email protected] # v4.19+
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +3 -1
index 3aac77a295ba..dad6e9ce66ba 100644
@@ -387,7 +387,9 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
 
 	/* enable external reference clock */
 	val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK);
-	val &= ~PHY_REFCLK_USE_PAD;
+	/* USE_PAD is required only for ipq806x */
+	if (!of_device_is_compatible(node, "qcom,pcie-apq8064"))
+		val &= ~PHY_REFCLK_USE_PAD;
 	val |= PHY_REFCLK_SSP_EN;
 	writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK);
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 4 lines · Ansuel Smith

The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. It was tested that while apq doesn't require the padding, ipq SoC must use it or the kernel hangs on boot.

Quoted 8 lines
Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev 2.1.0")
Cc [email protected] # v4.19+
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Need qcom maintainer's ack, thanks.

Lorenzo

Quoted 18 lines
drivers/pci/controller/dwc/pcie-qcom.c +3 -1
index 3aac77a295ba..dad6e9ce66ba 100644
@@ -387,7 +387,9 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
 
 	/* enable external reference clock */
 	val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK);
-	val &= ~PHY_REFCLK_USE_PAD;
+	/* USE_PAD is required only for ipq806x */
+	if (!of_device_is_compatible(node, "qcom,pcie-apq8064"))
+		val &= ~PHY_REFCLK_USE_PAD;
 	val |= PHY_REFCLK_SSP_EN;
 	writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK);
 
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#2 lore raw
In reply to Ansuel Smith

Thanks for the patch!

Quoted 9 lines · Ansuel Smith

The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. It was tested that while apq doesn't require the padding, ipq SoC must use it or the kernel hangs on boot.

Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev 2.1.0")
Cc [email protected] # v4.19+
Quoted 20 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
index 3aac77a295ba..dad6e9ce66ba 100644
@@ -387,7 +387,9 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
 
 	/* enable external reference clock */
 	val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK);
-	val &= ~PHY_REFCLK_USE_PAD;
+	/* USE_PAD is required only for ipq806x */
+	if (!of_device_is_compatible(node, "qcom,pcie-apq8064"))
+		val &= ~PHY_REFCLK_USE_PAD;
 	val |= PHY_REFCLK_SSP_EN;
 	writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK);
 
Signature · 2 lines
regards,
Stan
#4 lore raw
In reply to Ansuel Smith
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 11 lines · On Mon, 19 Oct 2020 18:55:55 +0200 you wrote:

The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. It was tested that while apq doesn't require the padding, ipq SoC must use it or the kernel hangs on boot.

Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev 2.1.0")
Cc [email protected] # v4.19+

[...]

Here is the summary with links:
- [RESEND] PCI: qcom: use PHY_REFCLK_USE_PAD only for ipq8064

    https://git.kernel.org/qcom/c/2cfef1971aea

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html