Re: [PATCH rtw-next 3/5] wifi: rtw88: sdio: limit the TX queue length of the 88xx chips
From: Luka Gejak
Date: Tue Nov 17 2026 - 02:22:05 EST
Hi David,
On November 16, 2026 8:01:43 PM GMT+01:00, "David Härdeman"
<david@xxxxxxxxxxx> wrote:
> + if (ret == -EBUSY && !rtw_chip_wcpu_8051(rtwdev))
> + resched = true;
I think -ENOMEM needs a retry here too. mmc_io_rw_extended() allocates a
scatterlist when a transfer needs more than one segment. For example,
dw_mmc with IDMAC sets max_seg_size to 4096, so an aggregate larger than
that can fail this allocation and return -ENOMEM.
The aggregate is put back in the queue on error. If the retry loop keeps
failing while the queue is stopped, no further attempt is scheduled.
Fresh TX callbacks can kick the worker again, including for the same AC,
but if no more arrive, recovering memory alone leaves the queued frames
stalled. The single frame fallback can also return -ENOMEM from
__skb_pad().
Could this handle -ENOMEM as the RTL8723BS retry helper already does?
[ ... ]
> + if (resched)
> + queue_delayed_work(rtwsdio->txwq, &work_data->work,
> + RTW_SDIO_TX_RETRY_DELAY);
So if I read it right, this also needs the work to be cancelled when the
SDIO interface stops. The power off path is:
rtw_power_off()
rtw_hci_stop()
rtw_sdio_stop()
rtw_mac_power_off()
rtw_sdio_stop() only disables interrupts and invalidates the credits.
The cancellation is in rtw_sdio_deinit_tx(), which closing the interface
does not call. The flush callback does not drain the SDIO software queues
either, since the SDIO operations have no flush_queues callback.
A pending retry can therefore run after power off and keep rearming
while credits are unavailable. The RTL8723BS retry helper seems to have
the same lifetime gap already, so maybe the shared stop path is the right
place to fix this before extending the retries to the other chips?
Best regards,
Luka Gejak