[PATCH 7.3.y] net: macb: wait for a running xmit before resetting BQL on close
From: Nicolai Buchwitz
Date: Mon Nov 09 2026 - 08:19:18 EST
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@xxxxxxxxxxx>
---
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 261a7e87520a4..9b3008b888bc4 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3236,14 +3236,16 @@ static int macb_close(struct net_device *netdev)
unsigned long flags;
unsigned int q;
- netif_tx_stop_all_queues(netdev);
-
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(netdev, q));
}
+ netif_tx_disable(netdev);
+
+ for (q = 0; q < bp->num_queues; ++q)
+ netdev_tx_reset_queue(netdev_get_tx_queue(netdev, q));
+
cancel_delayed_work_sync(&bp->tx_lpi_work);
phylink_stop(bp->phylink);
---
base-commit: d50d994bffa3c7c6db2d8bc4c5f0c55e3f46b0cd
change-id: 20261109-nb-macb-close-7-3-y-1a0d2f031b56
Best regards,
--
Nicolai Buchwitz <nb@xxxxxxxxxxx>