Skip to contentSkip to conversation

pci: pcie_dw_meson: fix usb fail when pci link fails to go up

PATCH In review Neil Armstrong 2 participants 3 messages Sep 8, 2021 – Sep 21, 2021

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

PATCH 1/1 pci: pcie_dw_meson: fix usb fail when pci link fails to go up

On Amlogic A311D, when the PCIe link fails disabling the related clocks makes USB fail. For an unknown reason, this doesn happen on the S905D3 SoC.

Mimic the Linux behavior by not considering a link failure a probe failure, and continue even if the PCIe link is down.

---
 drivers/pci/pcie_dw_meson.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/pci/pcie_dw_meson.c +1 -7
index 0525ecbea6..07da9fa533 100644
@@ -319,15 +319,9 @@ static int meson_pcie_init_port(struct udevice *dev)
 
 	pcie_dw_setup_host(&priv->dw);
 
-	ret = meson_pcie_link_up(priv, LINK_SPEED_GEN_2);
-	if (ret < 0)
-		goto err_link_up;
+	meson_pcie_link_up(priv, LINK_SPEED_GEN_2);
 
 	return 0;
-err_link_up:
-	clk_disable(&priv->clk_port);
-	clk_disable(&priv->clk_general);
-	clk_disable(&priv->clk_pclk);
 err_deassert_bulk:
 	reset_assert_bulk(&priv->rsts);
 err_power_off_phy:
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Neil Armstrong

On Amlogic A311D, when the PCIe link fails disabling the related clocks makes USB fail. For an unknown reason, this doesn happen on the S905D3 SoC.

Quoted 9 lines

Mimic the Linux behavior by not considering a link failure a probe failure, and continue even if the PCIe link is down.

---
 drivers/pci/pcie_dw_meson.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
#2 lore raw
In reply to Neil Armstrong
Quoted 24 lines · Neil Armstrong

On Amlogic A311D, when the PCIe link fails disabling the related clocks makes USB fail. For an unknown reason, this doesn happen on the S905D3 SoC.

Mimic the Linux behavior by not considering a link failure a probe failure, and continue even if the PCIe link is down.

---
 drivers/pci/pcie_dw_meson.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/pci/pcie_dw_meson.c +0 -3
index 0525ecbea6..07da9fa533 100644
@@ -319,15 +319,9 @@ static int meson_pcie_init_port(struct udevice *dev)
 
 	pcie_dw_setup_host(&priv->dw);
 
-	ret = meson_pcie_link_up(priv, LINK_SPEED_GEN_2);
-	if (ret < 0)
-		goto err_link_up;

drivers/pci/pcie_dw_meson.c static int meson_pcie_init_port(struct udevice *dev) · line 327

Quoted 10 lines
drivers/pci/pcie_dw_meson.c +1 -4
+	meson_pcie_link_up(priv, LINK_SPEED_GEN_2);
 
 	return 0;
-err_link_up:
-	clk_disable(&priv->clk_port);
-	clk_disable(&priv->clk_general);
-	clk_disable(&priv->clk_pclk);
 err_deassert_bulk:
 	reset_assert_bulk(&priv->rsts);
 err_power_off_phy:

Applied to u-boot-amlogic-next

Neil