aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mdio
diff options
context:
space:
mode:
authorBaruch Siach <baruch.siach@siklu.com>2022-02-21 13:45:57 +0200
committerDavid S. Miller <davem@davemloft.net>2022-02-21 13:04:53 +0000
commitb6ad6261d27708567b309fdb3102b12c42a070cc (patch)
tree61575b0b96c9c539846ceefeae3157df5980dea8 /drivers/net/mdio
parentgso: do not skip outer ip header in case of ipip and net_failover (diff)
downloadlinux-dev-b6ad6261d27708567b309fdb3102b12c42a070cc.tar.xz
linux-dev-b6ad6261d27708567b309fdb3102b12c42a070cc.zip
net: mdio-ipq4019: add delay after clock enable
Experimentation shows that PHY detect might fail when the code attempts MDIO bus read immediately after clock enable. Add delay to stabilize the clock before bus access. PHY detect failure started to show after commit 7590fc6f80ac ("net: mdio: Demote probed message to debug print") that removed coincidental delay between clock enable and bus access. 10ms is meant to match the time it take to send the probed message over UART at 115200 bps. This might be a far overshoot. Fixes: 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver") Signed-off-by: Baruch Siach <baruch.siach@siklu.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio')
-rw-r--r--drivers/net/mdio/mdio-ipq4019.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/mdio/mdio-ipq4019.c b/drivers/net/mdio/mdio-ipq4019.c
index 5f4cd24a0241..4eba5a91075c 100644
--- a/drivers/net/mdio/mdio-ipq4019.c
+++ b/drivers/net/mdio/mdio-ipq4019.c
@@ -200,7 +200,11 @@ static int ipq_mdio_reset(struct mii_bus *bus)
if (ret)
return ret;
- return clk_prepare_enable(priv->mdio_clk);
+ ret = clk_prepare_enable(priv->mdio_clk);
+ if (ret == 0)
+ mdelay(10);
+
+ return ret;
}
static int ipq4019_mdio_probe(struct platform_device *pdev)