All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Alastair D'Silva <alastair@d-silva.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Kalle Valo <kvalo@kernel.org>
Cc: Luka Gejak <luka.gejak@linux.dev>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Ulf Hansson <ulfh@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH rtw-next v10 2/4] wifi: rtw88: sdio: Track running state and cancel TX worker on stop
Date: Tue, 17 Nov 2026 06:15:13 +0000	[thread overview]
Message-ID: <74ed5d7ad4b04a2591ae0071cc8280ab@realtek.com> (raw)
In-Reply-To: <20261113082242.2773369-3-alastair@d-silva.org>

Alastair D'Silva <alastair@d-silva.org> wrote:
> When rtw_sdio_stop() disables interrupts, in-flight interrupt handlers or
> delayed TX work may still run against a powered-down device.
> 
> Track the operational state in rtwsdio->running with an irq_lock mutex
> (similar to PCI), check it at the entry of rtw_sdio_handle_interrupt()
> and rtw_sdio_tx_handler(), serialize state transitions in rtw_sdio_start()
> and rtw_sdio_stop() under sdio_claim_host() and irq_lock, and cancel the
> TX worker synchronously in rtw_sdio_stop().
> 
> Drain rtwsdio->tx_queue[] with locked skb_dequeue() and
> ieee80211_free_txskb() in rtw_sdio_stop() and again in rtw_sdio_start() to
> catch any frames queued by an in-flight rtwdev->tx_work after
> rtw_sdio_stop() completes, and reset rtwsdio->tx_queue_stopped[] while
> waking stopped AC queues under tx_queue[].lock in rtw_sdio_start().
> 
> Fixes: 28eaf7971a20 ("wifi: rtw88: sdio: add TX back-pressure and retry on page starvation")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM

No need Assisted-by tag now.

> Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>

Take my acked-by to v11 with small nit below.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

[...]

>  static int rtw_sdio_start(struct rtw_dev *rtwdev)
>  {
> +       struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
> +       enum rtw_tx_queue_type queue;
>         u32 clear;
> +       int i;
> 
>         if (rtw_is_8723bs(rtwdev)) {
>                 int ret = rtw_sdio_8723bs_check_rqpn(rtwdev);
> @@ -1069,20 +1086,49 @@ static int rtw_sdio_start(struct rtw_dev *rtwdev)
> 
>         rtw_sdio_enable_rx_aggregation(rtwdev);
> 
> +       rtw_sdio_purge_tx_queues(rtwdev);
> +
> +       for (i = 0; i < IEEE80211_NUM_ACS; i++) {
> +               queue = rtw_tx_ac_to_hwq(i);
> +               scoped_guard(spinlock_irqsave, &rtwsdio->tx_queue[queue].lock) {
> +                       if (rtwsdio->tx_queue_stopped[queue]) {
> +                               rtwsdio->tx_queue_stopped[queue] = false;
> +                               ieee80211_wake_queue(rtwdev->hw, i);
> +                       }
> +               }
> +       }

Create a function to reset TX queues state. 

In rtw_sdio_start(), this is a cleanup operation, but it takes up too much space
(blurring the focus).

> +
> +       sdio_claim_host(rtwsdio->sdio_func);
> +

[...]



  reply	other threads:[~2026-11-17  6:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  8:22 [PATCH rtw-next v10 0/4] wifi: rtw88: sdio: Fix unhandled RX request interrupt storm Alastair D'Silva
2026-11-13  8:22 ` [PATCH rtw-next v10 1/4] wifi: rtw88: sdio: Handle allocation and read errors in rtw_sdio_rxfifo_recv Alastair D'Silva
2026-11-13  8:22 ` [PATCH rtw-next v10 2/4] wifi: rtw88: sdio: Track running state and cancel TX worker on stop Alastair D'Silva
2026-11-17  6:15   ` Ping-Ke Shih [this message]
2026-11-13  8:22 ` [PATCH rtw-next v10 3/4] wifi: rtw88: sdio: Fix unhandled RX request interrupt storm Alastair D'Silva
2026-11-17  6:20   ` Ping-Ke Shih
2026-11-13  8:22 ` [PATCH rtw-next v10 4/4] wifi: rtw88: sdio: Split rtw_sdio_rx_isr into 8051 and 3081 variants Alastair D'Silva

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=74ed5d7ad4b04a2591ae0071cc8280ab@realtek.com \
    --to=pkshih@realtek.com \
    --cc=alastair@d-silva.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luka.gejak@linux.dev \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=stable@vger.kernel.org \
    --cc=ulfh@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.