Skip to content

WIP macb stall patches - #7667

Draft
nbuchwitz wants to merge 3 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/macb-stall
Draft

nbuchwitz wants to merge 3 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/macb-stall

Conversation

@nbuchwitz

Copy link
Copy Markdown
Contributor

Some patches to try with #7661

@nbuchwitz

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant