Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: "David Härdeman" <david@hardeman.nu>,
	"Ping-Ke Shih" <pkshih@realtek.com>,
	linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Leonard Lausen <leonard@lausen.nl>,
	Alastair D'Silva <alastair@d-silva.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH rtw-next 3/5] wifi: rtw88: sdio: limit the TX queue length of the 88xx chips
Date: Tue, 17 Nov 2026 08:21:50 +0100	[thread overview]
Message-ID: <B58755EF-D7EC-47C5-8DED-EB19A880CE26@linux.dev> (raw)
In-Reply-To: <20261116190145.2736364-4-david@hardeman.nu>

Hi David,

On November 16, 2026 8:01:43 PM GMT+01:00, "David Härdeman"
<david@hardeman.nu> 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

  reply	other threads:[~2026-11-17  7:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 19:01 [PATCH rtw-next 0/5] wifi: rtw88: sdio: faster and fairer TX for the 88xx chips David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 1/5] wifi: rtw88: sdio: cache the free TX page counts of " David Härdeman
2026-11-17  7:20   ` Luka Gejak
2026-11-16 19:01 ` [PATCH rtw-next 2/5] wifi: rtw88: sdio: aggregate TX frames " David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 3/5] wifi: rtw88: sdio: limit the TX queue length " David Härdeman
2026-11-17  7:21   ` Luka Gejak [this message]
2026-11-16 19:01 ` [PATCH rtw-next 4/5] wifi: rtw88: sdio: let TX in while receiving on " David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 5/5] wifi: rtw88: sdio: read neighbouring registers of the 88xx chips at once David Härdeman
2026-11-16 21:59 ` [PATCH rtw-next 0/5] wifi: rtw88: sdio: faster and fairer TX for the 88xx chips Luka Gejak
2026-11-17  7:46 ` Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B58755EF-D7EC-47C5-8DED-EB19A880CE26@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=alastair@d-silva.org \
    --cc=david@hardeman.nu \
    --cc=jernej.skrabec@gmail.com \
    --cc=leonard@lausen.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox