[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9b9a88b-f6ab-25ca-74c2-474c2f1c891f@bootlin.com>
Date: Tue, 16 Apr 2024 09:33:04 +0200 (CEST)
From: Romain Gantois <romain.gantois@...tlin.com>
To: Serge Semin <fancer.lancer@...il.com>
cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Russell King <linux@...linux.org.uk>,
Yanteng Si <siyanteng@...ngson.cn>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
"Gan, Yi Fang" <yi.fang.gan@...el.com>, Simon Horman <horms@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 2/4] net: stmmac: Fix max-speed being ignored on
queue re-init
On Fri, 12 Apr 2024, Serge Semin wrote:
> 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: 95201f36f395 ("net: stmmac: update MAC capabilities when tx queues are updated")
> Signed-off-by: Serge Semin <fancer.lancer@...il.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index dd58c21b53ee..b8a1f02398ee 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7328,6 +7328,7 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
> {
> struct stmmac_priv *priv = netdev_priv(dev);
> int ret = 0, i;
> + int max_speed;
>
> if (netif_running(dev))
> stmmac_release(dev);
> @@ -7343,6 +7344,10 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
>
> stmmac_mac_phylink_get_caps(priv);
>
> + max_speed = priv->plat->max_speed;
> + if (max_speed)
> + phylink_limit_mac_speed(&priv->phylink_config, max_speed);
> +
> stmmac_napi_add(dev);
>
> if (netif_running(dev))
> --
> 2.43.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Reviewed-by: Romain Gantois <romain.gantois@...tlin.com>
Powered by blists - more mailing lists