[PATCH net-next v13 1/5] net: stmmac: selftests: Prevent RXC from being disabled in LPI
Lorenzo Bianconi
lorenzo.bianconi at oss.qualcomm.com
Wed Nov 25 06:48:46 PST 2026
From: Maxime Chevallier <maxime.chevallier at bootlin.com>
RXC is critical to the RX path and some register banks in stmmac, so
it is blocked from being disabled in LPI when we know we're going
to need that clock.
During selftests, we're in MAC loopback so the PHY may enter LPI and
stop its RXC. This will prevent the RX path from properly receiving
the looped-back packets, hence failing the selftests.
As NETIF_F_VLAN_FEATURES may be empty on some platforms once the
software VLAN stripping is removed, the phylink config attribute
'eee_rx_clk_stop_enable' may no longer be unconditionally set to
false, hence allowing RXC to be disabled during LPI on platforms
that don't have any VLAN features. This is already the case for
CONFIG_VLAN_8021Q=n builds.
Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
Signed-off-by: Maxime Chevallier <maxime.chevallier at bootlin.com>
Signed-off-by: Peilin He <he.peilin at zte.com.cn>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index df696e2c1528..41a8493cf9dd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -1940,12 +1940,14 @@ void stmmac_selftest_run(struct net_device *dev,
return;
}
+ phylink_rx_clk_stop_block(priv->phylink);
for (i = 0; i < count; i++) {
ret = stmmac_selftests[i].fn(priv);
if (ret && (ret != -EOPNOTSUPP))
etest->flags |= ETH_TEST_FL_FAILED;
buf[i] = ret;
}
+ phylink_rx_clk_stop_unblock(priv->phylink);
stmmac_set_mac_loopback(priv, priv->ioaddr, false);
}
--
2.56.1
More information about the linux-arm-kernel
mailing list