RE: [PATCH net-next 2/3] net: stmmac: remove useless priv->flow_ctrl

nobuhiro1.iwamatsu
2025-02-19T01:13:18Z

Hi Russell,

> -----Original Message-----
> From: Russell King <rmk@armlinux.org.uk> On Behalf Of Russell King (Oracle)
> Sent: Tuesday, February 18, 2025 7:25 PM
> To: netdev@vger.kernel.org
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; Chen-Yu Tsai <wens@csie.org>; David S. Miller
> <davem@davemloft.net>; Drew Fustini <drew@pdp7.com>; Emil Renner
> Berthing <kernel@esmil.dk>; Eric Dumazet <edumazet@google.com>; Fabio
> Estevam <festevam@gmail.com>; Fu Wei <wefu@redhat.com>; Guo Ren
> <guoren@kernel.org>; imx@lists.linux.dev; Jakub Kicinski
> <kuba@kernel.org>; Jan Petrous <jan.petrous@oss.nxp.com>; Jernej Skrabec
> <jernej.skrabec@gmail.com>; Jerome Brunet <jbrunet@baylibre.com>; Kevin
> Hilman <khilman@baylibre.com>; linux-amlogic@lists.infradead.org;
> linux-arm-kernel@lists.infradead.org; linux-arm-msm@vger.kernel.org;
> linux-riscv@lists.infradead.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-sunxi@lists.linux.dev; Martin Blumenstingl
> <martin.blumenstingl@googlemail.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Minda Chen
> <minda.chen@starfivetech.com>; Neil Armstrong
> <neil.armstrong@linaro.org>; iwamatsu nobuhiro(岩松 信洋 ○ＤＩＴＣ□Ｄ
> ＩＴ○ＯＳＴ) <nobuhiro1.iwamatsu@toshiba.co.jp>; NXP S32 Linux Team
> <s32@nxp.com>; Paolo Abeni <pabeni@redhat.com>; Pengutronix Kernel
> Team <kernel@pengutronix.de>; Samuel Holland <samuel@sholland.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Shawn Guo
> <shawnguo@kernel.org>; Vinod Koul <vkoul@kernel.org>
> Subject: [PATCH net-next 2/3] net: stmmac: remove useless priv->flow_ctrl
>
> priv->flow_ctrl is only accessed by stmmac_main.c, and the only place
> that it is read is in stmmac_mac_flow_ctrl(). This function is only called from
> stmmac_mac_link_up() which always sets priv->flow_ctrl immediately before
> calling this function.
>
> Therefore, initialising this at probe time is ineffectual because it will always be
> overwritten before it's read. As such, the "flow_ctrl"
> module parameter has been useless for some time. Rather than remove the
> module parameter, which would risk module load failure, change the
> description to indicate that it is obsolete, and warn if it is set by userspace.
>
> Moreover, storing the value in the stmmac_priv has no benefit as it's set and
> then immediately read stmmac_mac_flow_ctrl(). Instead, pass it as a
> parameter to this function..
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

Best regards,
Nobuhiro