Skip to content

Commit 59c3d6c

Browse files
fancerPaolo Abeni
authored and
Paolo Abeni
committed
net: stmmac: Fix max-speed being ignored on queue re-init
It's possible to have the maximum link speed being artificially limited on the platform-specific basis. It's done either by setting up the plat_stmmacenet_data::max_speed field or by specifying the "max-speed" DT-property. In such cases it's required that any specific MAC-capabilities re-initializations would take the limit into account. In particular the link speed capabilities may change during the number of active Tx/Rx queues re-initialization. But the currently implemented procedure doesn't take the speed limit into account. Fix that by calling phylink_limit_mac_speed() in the stmmac_reinit_queues() method if the speed limitation was required in the same way as it's done in the stmmac_phy_setup() function. Fixes: 95201f3 ("net: stmmac: update MAC capabilities when tx queues are updated") Signed-off-by: Serge Semin <[email protected]> Reviewed-by: Romain Gantois <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 0ebd96f commit 59c3d6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -7328,6 +7328,7 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
73287328
{
73297329
struct stmmac_priv *priv = netdev_priv(dev);
73307330
int ret = 0, i;
7331+
int max_speed;
73317332

73327333
if (netif_running(dev))
73337334
stmmac_release(dev);
@@ -7343,6 +7344,10 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
73437344

73447345
stmmac_mac_phylink_get_caps(priv);
73457346

7347+
max_speed = priv->plat->max_speed;
7348+
if (max_speed)
7349+
phylink_limit_mac_speed(&priv->phylink_config, max_speed);
7350+
73467351
stmmac_napi_add(dev);
73477352

73487353
if (netif_running(dev))

0 commit comments

Comments
 (0)