[PATCH] net: designware_eqos: leave the MAC alone while the link is down

Ahmad Fatoum a.fatoum at barebox.org
Sun Nov 8 12:16:12 PST 2026


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.

Assisted-by: Claude:opus-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 drivers/net/designware_eqos.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 763e52f3d70f..68394bf3df17 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -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
-- 
2.47.3




More information about the barebox mailing list