Skip to content

Commit 33fe956

Browse files
Ovidiu Panaitgregkh
authored andcommitted
net: stmmac: Disable EEE RX clock stop when VLAN is enabled
commit c171e67 upstream. On the Renesas RZ/V2H EVK platform, where the stmmac MAC is connected to a Microchip KSZ9131RNXI PHY, creating or deleting VLAN interfaces may fail with timeouts: # ip link add link end1 name end1.5 type vlan id 5 15c40000.ethernet end1: Timeout accessing MAC_VLAN_Tag_Filter RTNETLINK answers: Device or resource busy Disabling EEE at runtime avoids the problem: # ethtool --set-eee end1 eee off # ip link add link end1 name end1.5 type vlan id 5 # ip link del end1.5 The stmmac hardware requires the receive clock to be running when writing certain registers, such as those used for MAC address configuration or VLAN filtering. However, by default the driver enables Energy Efficient Ethernet (EEE) and allows the PHY to stop the receive clock when the link is idle. As a result, the RX clock might be stopped when attempting to access these registers, leading to timeouts and other issues. Commit dd55726 ("net: stmmac: block PHY RXC clock-stop") addressed this issue for most register accesses by wrapping them in phylink_rx_clk_stop_block()/phylink_rx_clk_stop_unblock() calls. However, VLAN add/delete operations may be invoked with bottom halves disabled, where sleeping is not allowed, so using these helpers is not possible. Therefore, to fix this, disable the RX clock stop feature in the phylink configuration if VLAN features are set. This ensures the RX clock remains active and register accesses succeed during VLAN operations. Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/20251113112721.70500-3-ovidiu.panait.rb@renesas.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 53e821f commit 33fe956

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,11 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
12041204
/* Stmmac always requires an RX clock for hardware initialization */
12051205
config->mac_requires_rxc = true;
12061206

1207-
if (!(priv->plat->flags & STMMAC_FLAG_RX_CLK_RUNS_IN_LPI))
1207+
/* Disable EEE RX clock stop to ensure VLAN register access works
1208+
* correctly.
1209+
*/
1210+
if (!(priv->plat->flags & STMMAC_FLAG_RX_CLK_RUNS_IN_LPI) &&
1211+
!(priv->dev->features & NETIF_F_VLAN_FEATURES))
12081212
config->eee_rx_clk_stop_enable = true;
12091213

12101214
/* Set the default transmit clock stop bit based on the platform glue */

0 commit comments

Comments
 (0)