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 1/5] wifi: rtw88: sdio: cache the free TX page counts of the 88xx chips
Date: Tue, 17 Nov 2026 08:20:16 +0100	[thread overview]
Message-ID: <83F543B9-2066-493F-8372-0E36779C1B04@linux.dev> (raw)
In-Reply-To: <20261116190145.2736364-2-david@hardeman.nu>

Hi David,

Thanks for picking this up. One comment below.

On November 16, 2026 8:01:41 PM GMT+01:00, "David Härdeman"
<david@hardeman.nu> wrote:

> +     free_txpg[0] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG);
> +     free_txpg[1] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 4);
> +     free_txpg[2] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 8);

[ ... ]

> +     rtwsdio->free_txpg_valid = true;

As far as I can see, a failed read can leave bogus credits cached here.
While the chip is powered on, sdio_readl() returns 0xffffffff on an I/O
error, and rtw_sdio_read32() only logs the error. That becomes 4095 pages
in each affected page count.

The first frame can still fit the real page pool and be sent
successfully. The cache then stays valid, so the next frame can be
admitted using credits from the failed read even after the real pages
have been consumed. Previously, the next transfer would read the
registers again.

Could the sync return an error and leave the cache invalid unless all
three reads succeed? The individual reads used as a fallback in patch 5
would need to preserve their errors too.

Best regards,
Luka Gejak

  reply	other threads:[~2026-11-17  7:20 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 [this message]
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
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=83F543B9-2066-493F-8372-0E36779C1B04@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