* [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
@ 2026-11-09 12:57 Nicolai Buchwitz
2026-11-09 14:10 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Nicolai Buchwitz @ 2026-11-09 12:57 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman, Sasha Levin
Cc: Théo Lebrun, Conor Dooley, Nicolas Ferre, Claudiu Beznea,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Sean Anderson, netdev, linux-kernel,
Nicolai Buchwitz
macb_close() stops the queues without waiting for an xmit still
running on another CPU. That frame charges BQL after the reset and
never completes, so after the reopen the queue stays stopped with an
empty ring and the watchdog fires until the next close.
Seen on a Raspberry Pi CM5 with ethtool -G under load.
Upstream fixed this as part of the context swap rework in commit
dcc3288b9433a ("net: macb: use context swapping in .set_ringparam()"),
which is too large for stable.
Fixes: e6a532185daa ("net: cadence: macb: Implement BQL")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
Fixes a close race in 6.18.y and 7.3.y. Older LTS kernels have no BQL
in macb and 7.4 has the fix through Théo's context swap series, so let's
keep the fix small instead of pulling that whole series in.
The stall was observed on a Raspberry Pi CM5 (2/30 close/open cycles under
load stalled), so it is worth fixing.
---
drivers/net/ethernet/cadence/macb_main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 1eaf9be483153..422dd167187da 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3156,14 +3156,16 @@ static int macb_close(struct net_device *dev)
unsigned long flags;
unsigned int q;
- netif_tx_stop_all_queues(dev);
-
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
napi_disable(&queue->napi_rx);
napi_disable(&queue->napi_tx);
- netdev_tx_reset_queue(netdev_get_tx_queue(dev, q));
}
+ netif_tx_disable(dev);
+
+ for (q = 0; q < bp->num_queues; ++q)
+ netdev_tx_reset_queue(netdev_get_tx_queue(dev, q));
+
phylink_stop(bp->phylink);
phylink_disconnect_phy(bp->phylink);
---
base-commit: c3f63d70f236bb7685e6d11d1d9b5b351552e600
change-id: 20261109-nb-macb-close-6-18-y-126903425567
Best regards,
--
Nicolai Buchwitz <nb@tipi-net.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
2026-11-09 12:57 [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close Nicolai Buchwitz
@ 2026-11-09 14:10 ` Greg Kroah-Hartman
2026-11-09 14:24 ` Nicolai Buchwitz
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-09 14:10 UTC (permalink / raw)
To: Nicolai Buchwitz
Cc: stable, Sasha Levin, Théo Lebrun, Conor Dooley,
Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Sean Anderson, netdev,
linux-kernel
On Mon, Nov 09, 2026 at 01:57:09PM +0100, Nicolai Buchwitz wrote:
> macb_close() stops the queues without waiting for an xmit still
> running on another CPU. That frame charges BQL after the reset and
> never completes, so after the reopen the queue stays stopped with an
> empty ring and the watchdog fires until the next close.
>
> Seen on a Raspberry Pi CM5 with ethtool -G under load.
>
> Upstream fixed this as part of the context swap rework in commit
> dcc3288b9433a ("net: macb: use context swapping in .set_ringparam()"),
> which is too large for stable.
Why is that too large? Please backport that instead.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close
2026-11-09 14:10 ` Greg Kroah-Hartman
@ 2026-11-09 14:24 ` Nicolai Buchwitz
0 siblings, 0 replies; 3+ messages in thread
From: Nicolai Buchwitz @ 2026-11-09 14:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, Sasha Levin, Théo Lebrun, Conor Dooley,
Nicolas Ferre, Claudiu Beznea, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Sean Anderson, netdev,
linux-kernel
Hi Greg
On 9.11.2026 15:10, Greg Kroah-Hartman wrote:
>
> Why is that too large? Please backport that instead.
Context swapping was a rather large change (+822 / -439 LOC) - if this
is
considered ok for stable backport, I will send the patches.
> [...]
Thanks,
Nicolai
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-09 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 12:57 [PATCH 6.18.y] net: macb: wait for a running xmit before resetting BQL on close Nicolai Buchwitz
2026-11-09 14:10 ` Greg Kroah-Hartman
2026-11-09 14:24 ` Nicolai Buchwitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®