Re: [PATCH rtw-next 5/5] wifi: rtw88: sdio: read neighbouring registers of the 88xx chips at once

From: Bitterblue Smith

Date: Wed Nov 18 2026 - 10:56:27 EST


On 16/11/2026 21:01, David Härdeman wrote:
> Every register access costs a full SDIO command, about 40 us on a NanoPi
> R76S (RTL8822CS, SDR104), no matter how many bytes it moves. The
> interrupt handler reads HISR and then RX0_REQ_LEN, which follows it, and
> a free page sync reads the three REG_SDIO_FREE_TXPG words one by one.
>
> Read HISR together with RX0_REQ_LEN, and the three free page words, with
> one transfer each, as Realtek's driver does. As in rtw_sdio_readl(),
> this is only done while the chip is powered on; before that, and if the
> small DMA-safe buffers this needs could not be allocated, the registers
> are read one by one as before.
>
> On the R76S acting as an AP, TCP throughput to a client goes from about
> 170 to about 190 Mbit/s, the other directions are unchanged.
>
> Signed-off-by: David Härdeman <david@xxxxxxxxxxx>
> ---
> drivers/net/wireless/realtek/rtw88/sdio.c | 84 ++++++++++++++++++++---
> drivers/net/wireless/realtek/rtw88/sdio.h | 4 ++
> 2 files changed, 78 insertions(+), 10 deletions(-)
>

[...]

> diff --git a/drivers/net/wireless/realtek/rtw88/sdio.h b/drivers/net/wireless/realtek/rtw88/sdio.h
> index ab366f82d92..6aa59ed3db2 100644
> --- a/drivers/net/wireless/realtek/rtw88/sdio.h
> +++ b/drivers/net/wireless/realtek/rtw88/sdio.h
> @@ -188,6 +188,10 @@ struct rtw_sdio {
> bool free_txpg_valid;
> /* TX aggregation buffer of the non-8051 chips, under tx_credit_lock */
> u8 *tx_agg_buf;
> + /* non-8051 chips: HISR + RX0_REQ_LEN, read by the interrupt handler */
> + __le32 *rx_regs;
> + /* non-8051 chips: the REG_SDIO_FREE_TXPG words, under tx_credit_lock */
> + __le32 *txpg_regs;
> /* one writer at a time between the credit check and the accounting */
> struct mutex tx_credit_lock;
> };

By the way, you can call them "3081 chips".