Skip to content

Commit ffba212

Browse files
anderssonkuba-moo
authored andcommitted
net: stmmac: dwmac-qcom-ethqos: Enable RGMII functional clock on resume
When the Qualcomm ethqos driver is properly described in its associated GDSC power-domain, the hardware will be powered down and loose its state between qcom_ethqos_probe() and stmmac_init_dma_engine(). The result of this is that the functional clock from the RGMII IO macro is no longer provides and the DMA software reset in dwmac4_dma_reset() will time out, due to lacking clock signal. Re-enable the functional clock, as part of the Qualcomm specific clock enablement sequence to avoid this problem. The final clock configuration will be adjusted by ethqos_fix_mac_speed() once the link is being brought up. Fixes: a7c30e6 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-and-reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Link: https://lore.kernel.org/r/20220323033255.2282930-1-bjorn.andersson@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 169e777 commit ffba212

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,13 @@ static int ethqos_clks_config(void *priv, bool enabled)
487487
dev_err(&ethqos->pdev->dev, "rgmii_clk enable failed\n");
488488
return ret;
489489
}
490+
491+
/* Enable functional clock to prevent DMA reset to timeout due
492+
* to lacking PHY clock after the hardware block has been power
493+
* cycled. The actual configuration will be adjusted once
494+
* ethqos_fix_mac_speed() is invoked.
495+
*/
496+
ethqos_set_func_clk_en(ethqos);
490497
} else {
491498
clk_disable_unprepare(ethqos->rgmii_clk);
492499
}

0 commit comments

Comments
 (0)