Repository navigation
WIP macb stall patches - #7667
Draft
nbuchwitz wants to merge 5 commits into
Draft
WIP macb stall patches #7667nbuchwitz wants to merge 5 commits into
nbuchwitz wants to merge 5 commits into
Conversation
nbuchwitz
force-pushed
the
devel/macb-stall
branch
from
September 30, 2026 09:56
88fd650 to
e8ebfe7
Compare
Contributor
Author
|
@pelwell, can you please trigger the builds? Thanks |
When the frames went out but their TCOMP interrupt got lost, TBQP already matches tx_head and macb_tx_restart() does nothing. TX NAPI never runs again and the queue stays stopped for good. Fixes: e438ec3 ("net: macb: add TX stall timeout callback to recover from lost TSTART write") Link: raspberrypi#7661 [nb: open-code macb_queue_isr_clear(), not available in 6.18] Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
The frames dropped on a TX error are never returned to BQL. Each error shrinks the BQL budget for good until the queue stops with an empty ring. netdev_tx_reset_queue() is not safe here as the task runs without tx_ptr_lock, so macb_start_xmit() may still be queueing. Fixes: e6a5321 ("net: cadence: macb: Implement BQL") Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
nbuchwitz
force-pushed
the
devel/macb-stall
branch
from
October 18, 2026 09:57
e8ebfe7 to
8a4f54b
Compare
Contributor
Author
|
@pelwell can you please re-trigger the build? Thanks! |
The IER write at the end of macb_tx_poll() is posted, so the ring check right after it can run before TCOMP is unmasked. A frame that completes in that window never raises an interrupt. With TSO this happens when TXUBR triggers a poll while the frame is still on the wire. BQL keeps the queue stopped on that frame and only the watchdog gets it going again. Read IMR back after the write so the check runs with TCOMP unmasked. macb_rx_poll() has the same window. Fixes: 138badb ("net: macb: use NAPI for TX completion path") Fixes: 0bf476f ("net: macb: Fix lost RX packet wakeup race in NAPI receive") Link: raspberrypi#7661 Link: https://lore.kernel.org/netdev/20260514215459.36109-3-lukasz@raczylo.com/ Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
nbuchwitz
force-pushed
the
devel/macb-stall
branch
from
October 21, 2026 20:59
8a4f54b to
d9a828b
Compare
gem_shuffle_tx_one_ring() rotates the software TX ring so that the tail sits at index 0 and resets queue->tx_tail to 0, but it never reprograms the hardware transmit buffer queue pointer (TBQP). Other paths that reset tx_tail to the ring base (macb_init_buffers() and macb_tx_error_task()) also reprogram TBQP to queue->tx_ring_dma; this path does not, leaving TBQP pointing at a stale descriptor. gem_shuffle_tx_rings() runs on every link-up from macb_mac_link_up(). After a few link up/down flaps that leave un-completed descriptors in the ring, the stale TBQP keeps pointing at a descriptor whose used bit is set. When TX is re-enabled on link-up, the GEM reads that used descriptor and raises TXUBR. macb_interrupt() schedules the TX NAPI, macb_tx_poll() makes no progress (work_done == 0) and macb_tx_restart() re-issues TSTART, which makes the controller read the same used descriptor again and re-assert TXUBR. As the MAC interrupt is level-triggered, it never deasserts and one CPU is pegged at 100% in the threaded handler, eventually triggering "sched: RT throttling activated" and a dead network interface. Fix it by reprogramming TBQP to the ring base on every path of gem_shuffle_tx_one_ring() that resets tx_tail to 0, mirroring macb_tx_error_task(). The early return for an already-aligned tail is left untouched as TBQP is already consistent there. This is safe because the shuffle runs from macb_mac_link_up() while TE is still disabled, so the transmitter is halted. Fixes: 881a026 ("net: macb: Shuffle the tx ring before enabling tx") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-8 Link: https://lore.kernel.org/netdev/20261022-std-macb-v14-send-v1-2-9187bc545bf6@beckhoff.com/ Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Write TSTART in macb_mac_link_up() for every queue that still has frames outstanding once transmit has been re-enabled. Frames queued before a link-down stay in the ring, and setting NCR.TE does not start the transmitter; the driver relies on the next macb_start_xmit() to write TSTART. If BQL stopped the queue before the link went down, that transmit never comes and the queue stays idle until the netdev watchdog fires. Like the rotation, the kick is skipped on the at91rm9200 EMAC, which uses its own TX path. Fixes: 881a026 ("net: macb: Shuffle the tx ring before enabling tx") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/netdev/20261022-std-macb-v14-send-v1-5-9187bc545bf6@beckhoff.com/ Assisted-by: LLM Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com> [nb: taken without the rotation rework it sits on, the kick goes right after TE is set] Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some patches to try with #7661