From: Maxime Chevallier 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 the 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 inconditionnally set to true, hence allowing RXC to be disabled during LPI on platforms that don't have any VLAN features. Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support") Signed-off-by: Maxime Chevallier Signed-off-by: Peilin He --- 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 664d7cfde2f1..4f4d61a9c098 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -1847,12 +1847,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.43.0