From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: linux-sunxi@lists.linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH net v4 15/15] net: stmmac: retain DMA resources across MTU changes
Date: Sun, 27 Sep 2026 15:50:06 +0000 [thread overview]
Message-ID: <20260927155007.06FB61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260926-submit-stmmac-reset-fixes-v1-v4-15-ec1c0250b3c9@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: stmmac: double disable of NAPI causing deadlock in stmmac_reconfigure_mtu()
--
commit ed7896fe947ec45eb3dddd37b9ca9ed5f20ea4e9
Author: James Hilliard <james.hilliard1@gmail.com>
net: stmmac: retain DMA resources across MTU changes
This commit modifies the MTU change procedure to prepare the replacement
configuration before quiescing the old datapath. It retains the rings and IRQ
registrations until setup succeeds so rollback needs no new allocations, and
leaves the interface detached in a distinct HALTED state if rollback fails.
> 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
[ ... ]
> @@ -6601,6 +6651,109 @@ static void stmmac_set_rx_mode(struct net_device *dev)
> stmmac_set_filter(priv, priv->hw, dev);
> }
>
> +static int stmmac_reconfigure_mtu(struct net_device *dev, int mtu)
> +{
> + struct stmmac_priv *priv = netdev_priv(dev);
> + struct stmmac_dma_conf *old_conf = priv->dma_conf;
> + struct stmmac_dma_conf *new_conf;
> + int old_mtu = dev->mtu;
> + int ret, restore_ret;
> + u32 irq_mask[STMMAC_CH_MAX];
> + u32 chan;
> +
> + new_conf = stmmac_setup_dma_desc(priv, mtu);
> + if (IS_ERR(new_conf))
> + return PTR_ERR(new_conf);
> +
> + mutex_lock(&priv->ptp_mutex);
> + stmmac_block_ptp(priv, true);
> + netif_device_detach(dev);
> + phylink_stop(priv->phylink);
> + stmmac_quiesce(priv);
[Severity: High]
Does this unconditional call to stmmac_quiesce() lead to a double-disable of
NAPI if the interface is already in the HALTED state?
If stmmac_reconfigure_mtu() fails to rollback after a hardware setup error,
the interface state is set to STMMAC_DATAPATH_HALTED with NAPI left disabled,
but the device remains administratively up (netif_running(dev) remains true).
If an MTU change is attempted again, stmmac_change_mtu() will call
stmmac_reconfigure_mtu() a second time. This unconditional stmmac_quiesce()
call will invoke stmmac_disable_all_queues(), resulting in a second
napi_disable() on the already disabled NAPI instances. This can cause the
kernel to deadlock in napi_disable_locked() while waiting for
NAPIF_STATE_SCHED to clear.
> + if (stmmac_fpe_supported(priv))
> + ethtool_mmsv_stop(&priv->fpe_cfg.mmsv);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260926-submit-stmmac-reset-fixes-v1-v4-0-ec1c0250b3c9@gmail.com?part=15
next prev parent reply other threads:[~2026-09-27 15:50 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 15:48 [PATCH net v4 00/15] net: stmmac: preserve datapath state across MTU and resume failures James Hilliard
2026-09-26 15:48 ` [PATCH net v4 01/15] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure James Hilliard
2026-09-26 15:48 ` [PATCH net v4 02/15] net: stmmac: reuse the MDIO reset GPIO on resume James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:48 ` [PATCH net v4 03/15] net: phylink: allow stopping a suspended instance James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:48 ` [PATCH net v4 04/15] xsk: freeze deferred pool teardown during system sleep James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 05/15] net: stmmac: serialize and retain PHC configuration across reset James Hilliard
2026-09-27 15:50 ` sashiko-bot
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 06/15] net: stmmac: leave the datapath running for normal-size MTU changes James Hilliard
2026-09-26 15:49 ` [PATCH net v4 07/15] net: stmmac: unwind partially allocated DMA configurations James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 08/15] net: stmmac: keep DMA configurations at stable addresses James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 09/15] net: stmmac: track datapath and power ownership across failed reopening James Hilliard
2026-09-27 15:50 ` sashiko-bot
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 10/15] net: stmmac: use the tracked datapath restart for XSK pool changes James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 11/15] net: stmmac: restore TC offloads before restarting DMA James Hilliard
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 12/15] xsk: allow drivers to retain DMA mappings independently of pools James Hilliard
2026-09-26 15:49 ` [PATCH net v4 13/15] net: stmmac: retain DMA memory until hardware shutdown completes James Hilliard
2026-09-27 15:50 ` sashiko-bot
2026-09-30 4:51 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 14/15] net: stmmac: prepare device-local DMA interrupt quiescence James Hilliard
2026-09-30 4:52 ` netdev-bot+sashiko
2026-09-26 15:49 ` [PATCH net v4 15/15] net: stmmac: retain DMA resources across MTU changes James Hilliard
2026-09-27 15:50 ` sashiko-bot [this message]
2026-09-30 4:52 ` netdev-bot+sashiko
2026-09-26 16:00 ` [PATCH net v4 00/15] net: stmmac: preserve datapath state across MTU and resume failures Maxime Chevallier
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=20260927155007.06FB61F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=james.hilliard1@gmail.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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