From: Stefan Agner <stefan@agner.ch>
To: Jakub Raczynski <j.raczynski@samsung.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Ovidiu Panait <ovidiu.panait.rb@renesas.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
regressions@lists.linux.dev
Subject: Re: [PATCH net] net: stmmac: resume PHY before reopening the interface on MTU change
Date: Tue, 07 Jul 2026 20:57:26 +0200 [thread overview]
Message-ID: <75d9132549fce2298f581318e2d2e80f@agner.ch> (raw)
In-Reply-To: <ak01QZhCKkq2FM33@AMDC4622.eu.corp.samsungelectronics.net>
On 2026-07-07 19:20, Jakub Raczynski wrote:
> On Tue, Jul 07, 2026 at 06:21:46PM +0200, Stefan Agner wrote:
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -5884,6 +5884,15 @@
>>
>> __stmmac_release(dev);
>>
>> + /* phylink_stop() in __stmmac_release() suspends the PHY.
>> + * IEEE 802.3 allows PHYs to stop their receive clock while
>> + * powered down, but the DMA software reset performed by
>> + * stmmac_hw_setup() requires a running receive clock.
>> + * Resume the PHY, as on system resume, to ensure its clocks
>> + * are running before reopening the interface.
>> + */
>> + phylink_prepare_resume(priv->phylink);
>
> Does it work without warnings? Nothing in dmesg?
With this patch applied, this is the dmesg log on MTU change:
[ 56.761175] rk_gmac-dwmac fe010000.ethernet end0: Register
MEM_TYPE_PAGE_POOL RxQ-0
[ 56.762769] rk_gmac-dwmac fe010000.ethernet end0: Link is Down
[ 56.801327] dwmac4: Master AXI performs any burst length
[ 56.801368] rk_gmac-dwmac fe010000.ethernet end0: No Safety Features
support found
[ 56.801409] rk_gmac-dwmac fe010000.ethernet end0: IEEE 1588-2008
Advanced Timestamp supported
[ 56.801780] rk_gmac-dwmac fe010000.ethernet end0: registered PTP
clock
[ 56.801804] rk_gmac-dwmac fe010000.ethernet end0: configuring for
phy/rgmii link mode
[ 61.032985] rk_gmac-dwmac fe010000.ethernet end0: Link is Up -
1Gbps/Full - flow control off
> phylink_prepare_resume() does have ASSERT_RTNL() which is not called anywhere.
I am not very familiar with the codebase, but Fable states:
> RTNL is held here: ndo_change_mtu is invoked from netif_set_mtu_ext(),
> which calls netdev_ops_assert_locked() — for a driver without instance
> locking such as stmmac that is ASSERT_RTNL() — right before calling the
> driver op.
What I can definitely confirm is that without this patch applied, a MTU
change does not succeed, with it applied MTU change works and the
network interface remains functional.
--
Stefan
next prev parent reply other threads:[~2026-07-07 18:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260707172005eucas1p2fdf3255132201e4e2c6fcc835fd2e805@eucas1p2.samsung.com>
2026-07-07 16:21 ` [PATCH net] net: stmmac: resume PHY before reopening the interface on MTU change Stefan Agner
2026-07-07 17:20 ` Jakub Raczynski
2026-07-07 18:57 ` Stefan Agner [this message]
2026-07-07 18:50 ` Andrew Lunn
2026-07-07 19:10 ` Stefan Agner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75d9132549fce2298f581318e2d2e80f@agner.ch \
--to=stefan@agner.ch \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=j.raczynski@samsung.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ovidiu.panait.rb@renesas.com \
--cc=pabeni@redhat.com \
--cc=regressions@lists.linux.dev \
--cc=rmk+kernel@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox