net: designware_eqos: leave the MAC alone while the link is down
PATCH 1/1 net: designware_eqos: leave the MAC alone while the link is down
The PHY core calls adjust_link on a link loss as well, with whatever speed and duplex the PHY driver falls back to, 10 Mbit/s half duplex for genphy, and eqos_adjust_link() programs the MAC for that.
On the Amlogic A9 (DWMAC 5.30 behind the G12A glue, which isn't in barebox yet), the detour over 10 Mbit/s every so often leaves the RGMII transmit path dead until the next speed change. On a BY401, that was about every other ifdown/ifup.
Let's configure the MAC only while the link is up, as Linux does. 20 ifdown/ifup cycles in a row work with that.
--- drivers/net/designware_eqos.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/designware_eqos.c +4 -0
@@ -317,6 +317,10 @@ void eqos_adjust_link(struct eth_device *edev)struct eqos *eqos = edev->priv;unsigned speed = edev->phydev->speed; +/* Like Linux, leave the MAC alone while the link is down */ +if (!edev->phydev->link) +return ; +if (edev->phydev->duplex)eqos_set_full_duplex (eqos);else
Signature · 1 line
2.47.3
Sascha Hauer
AppliedQuoted 10 lines · Ahmad Fatoum
The PHY core calls
adjust_linkon a link loss as well, with whatever speed and duplex the PHY driver falls back to, 10 Mbit/s half duplex for genphy, andeqos_adjust_link()programs the MAC for that.On the Amlogic A9 (DWMAC 5.30 behind the G12A glue, which isn't in barebox yet), the detour over 10 Mbit/s every so often leaves the RGMII transmit path dead until the next speed change. On a BY401, that was about every other ifdown/ifup.
[...]
Applied, thanks!
[1/1] net: designware_eqos: leave the MAC alone while the link is down
https://git.pengutronix.de/cgit/barebox/commit/?id=5f286bb04508 (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>