The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: luka.gejak@linux.dev
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: Luka Gejak <luka.gejak@linux.dev>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH v2 09/11] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation
Date: Thu, 30 Jul 2026 07:45:02 +0000	[thread overview]
Message-ID: <20260730074504.19725-8-luka.gejak@linux.dev> (raw)
In-Reply-To: <af51f851a5254faa9caba6b1e04fefe8@realtek.com>

From: Luka Gejak <luka.gejak@linux.dev>

On 27/07/2026 09:21, Ping-Ke Shih wrote:
>> +/* 8723BS SDIO TX FIFO back-pressure watermarks: stop the mac80211 queue once
> 
> comment style.

Fixed, both of them.

>> -       queue_work(rtwsdio->txwq, &rtwsdio->tx_handler_data->work);
>> +       mod_delayed_work(rtwsdio->txwq,
>> +                        &rtwsdio->tx_handler_data->work, 0);
> 
> queue_delayed_work()?

Changed inside the TX handler, where the work is not pending and
queue_delayed_work() is the right call.

I kept mod_delayed_work() in rtw_sdio_tx_kick_off() on purpose, because
there it can race with a pending retry. If a page shortage has already
armed the work with RTW_SDIO_TX_RETRY_DELAY, queue_delayed_work() would
see it pending and do nothing, so a newly queued frame would sit for up
to a millisecond for no reason. mod_delayed_work() re-arms it to fire
immediately. I have added a comment saying so.

>>         if (ret) {
>>                 skb_queue_head(&rtwsdio->tx_queue[queue], skb);
> 
> This case is also `processed = true`?
[...]
> Can you cleanup the handlers of return value and processed?
> The logic isn't clear to me.

You are right that it was not clear, and the requeue case was the
reason: the frame had been dequeued but not sent, so neither value
described it well. The out-parameter is gone. rtw_sdio_process_tx_queue()
now returns:

   1  a frame was written
   0  the queue was empty
  <0  the write failed and the frame is back at the head of the queue

which the handler reads as

	ret = rtw_sdio_process_tx_queue(rtwdev, queue);
	if (ret == 0)
		break;
	if (ret < 0) {
		if (rtl8723bs && ret == -EBUSY) {
			queue_delayed_work(... RTW_SDIO_TX_RETRY_DELAY);
			return;
		}
		break;
	}

with the management frame restart after it. Behaviour is unchanged; a
non-EBUSY error still moves on to the next queue.

Best regards,
Luka Gejak

  reply	other threads:[~2026-07-30  7:45 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25 15:04 [PATCH v2 00/11] wifi: rtw88: preparations for RTL8723B/RTL8723BS luka.gejak
2026-07-25 15:04 ` [PATCH v2 01/11] wifi: rtw88: add the RTL8723B chip type and SDIO helper luka.gejak
2026-07-27  7:12   ` Ping-Ke Shih
2026-07-27 13:25     ` Luka Gejak
2026-07-30  6:27       ` Luka Gejak
2026-07-30  9:21         ` Ping-Ke Shih
2026-07-30  7:44     ` luka.gejak
2026-07-30  9:17       ` Ping-Ke Shih
2026-07-30 14:28         ` Luka Gejak
2026-07-25 15:04 ` [PATCH v2 02/11] wifi: rtw88: rx: mark zero length packets on RTL8723BS luka.gejak
2026-07-27  7:14   ` Ping-Ke Shih
2026-07-30  7:44     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 03/11] wifi: rtw88: fw: add the GNT_BT firmware command luka.gejak
2026-07-25 15:04 ` [PATCH v2 04/11] wifi: rtw88: fw: fix the reserved page upload on RTL8723BS luka.gejak
2026-07-27  7:37   ` Ping-Ke Shih
2026-07-30  7:44     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 05/11] wifi: rtw88: coex: add the RTL8723BS scan antenna workaround luka.gejak
2026-07-27  7:58   ` Ping-Ke Shih
2026-07-30  7:44     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 06/11] wifi: rtw88: coex: reassert the antenna path when associating luka.gejak
2026-07-27  8:21   ` Ping-Ke Shih
2026-07-30  7:44     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 07/11] wifi: rtw88: sdio: track free TX pages and OQT credits for RTL8723BS luka.gejak
2026-07-27  8:52   ` Ping-Ke Shih
2026-07-30  7:45     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 08/11] wifi: rtw88: sdio: set up RX aggregation and interrupts " luka.gejak
2026-07-27  8:59   ` Ping-Ke Shih
2026-07-30  7:45     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 09/11] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation luka.gejak
2026-07-27  9:21   ` Ping-Ke Shih
2026-07-30  7:45     ` luka.gejak [this message]
2026-07-30  9:02       ` Ping-Ke Shih
2026-07-25 15:04 ` [PATCH v2 10/11] wifi: rtw88: record beacons from the target BSSID before authenticating luka.gejak
2026-07-27  9:27   ` Ping-Ke Shih
2026-07-30  7:45     ` luka.gejak
2026-07-25 15:04 ` [PATCH v2 11/11] wifi: rtw88: run the RTL8723BS association register sequence luka.gejak
2026-07-27  9:33   ` Ping-Ke Shih
2026-07-30  7:45     ` luka.gejak

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=20260730074504.19725-8-luka.gejak@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    --cc=straube.linux@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