net: mdio-ipq4019: add delay after clock enable
authorBaruch Siach <baruch.siach@siklu.com>
Mon, 21 Feb 2022 11:45:57 +0000 (13:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:47:58 +0000 (11:47 +0100)
commit7d258451d3454b168ba6df3c9e4cb26a8ce6b752
treeadaf8aa90ec352be32051e807b8e1e4357d68b80
parent9d8097caa73200710d52b9f4d9f430548f46a900
net: mdio-ipq4019: add delay after clock enable

commit b6ad6261d27708567b309fdb3102b12c42a070cc upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/mdio/mdio-ipq4019.c