Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: "luka.gejak@linux.dev" <luka.gejak@linux.dev>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Michael Straube" <straube.linux@gmail.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	"Hans de Goede" <johannes.goede@oss.qualcomm.com>
Subject: RE: [PATCH v5 6/6] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation
Date: Wed, 19 Aug 2026 01:14:11 +0000	[thread overview]
Message-ID: <257b9af907e84e439ae6a9fd55bf3f09@realtek.com> (raw)
In-Reply-To: <20260814105327.6687-7-luka.gejak@linux.dev>

luka.gejak@linux.dev <luka.gejak@linux.dev> wrote:
> +
> +static void rtw_sdio_reschedule_tx_work(struct rtw_dev *rtwdev,
> +                                       struct rtw_sdio_work_data *work_data,
> +                                       unsigned long delay)
> +{
> +       struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
> +
> +       queue_delayed_work(rtwsdio->txwq, &work_data->work, delay);
>  }

Actually, I didn't request this wrapper by v4. (Also I don't prefer a
simple wrapper like this that hides kernel API).

(See below)

> 
>  static void rtw_sdio_tx_handler(struct work_struct *work)
>  {
>         struct rtw_sdio_work_data *work_data =
> -               container_of(work, struct rtw_sdio_work_data, work);
> +               container_of(to_delayed_work(work), struct rtw_sdio_work_data,
> +                            work);
>         struct rtw_sdio *rtwsdio;
>         struct rtw_dev *rtwdev;
> -       int limit, queue;
> +       int limit, queue, ret;
> +       bool rtl8723bs;
> 
>         rtwdev = work_data->rtwdev;
>         rtwsdio = (struct rtw_sdio *)rtwdev->priv;
> +       rtl8723bs = rtw_is_8723bs(rtwdev);
> 
>         if (!rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_TX_WAKE))
>                 rtw_sdio_deep_ps_leave(rtwdev);
> 
>         for (queue = RTK_MAX_TX_QUEUE_NUM - 1; queue >= 0; queue--) {
>                 for (limit = 0; limit < 1000; limit++) {
> -                       rtw_sdio_process_tx_queue(rtwdev, queue);
> +                       ret = rtw_sdio_process_tx_queue(rtwdev, queue);
> +                       if (ret > 0)
> +                               break;
> +
> +                       if (ret < 0) {
> +                               /*
> +                                * A page or output queue shortage and a failed
> +                                * skb expansion are both transient, and the
> +                                * frame is still queued, so come back for it.
> +                                * That matters once the queue can be stopped:
> +                                * a stopped queue is handed no further frames,
> +                                * so nothing else would kick this work item and
> +                                * the queue would stay stopped for good. The
> +                                * remaining errors cannot succeed on a retry
> +                                * and each log where they happen.
> +                                */
> +                               if (rtl8723bs &&
> +                                   (ret == -EBUSY || ret == -ENOMEM)) {
> +                                       rtw_sdio_reschedule_tx_work(rtwdev, work_data,
> +                                                                   RTW_SDIO_TX_RETRY_DELAY);
> +                                       return;
> +                               }
> +                               break;
> +                       }
> +
> +                       /*
> +                        * Restart from the highest priority queue after every
> +                        * management frame so the join sequence is not held up
> +                        * behind a data backlog.
> +                        */
> +                       if (rtl8723bs && queue == RTW_TX_QUEUE_MGMT) {
> +                               rtw_sdio_reschedule_tx_work(rtwdev, work_data, 0);
> +                               return;
> +                       }

I'd move this chunk you are adding to a function. I think it is just to
reschedule TX work for RTL8723BS for certain conditions, but explaining 
a lot of things (conditions) in common flow makes people hard to read
the flow. 

> 
>                         if (skb_queue_empty(&rtwsdio->tx_queue[queue]))
>                                 break;




  reply	other threads:[~2026-08-19  1:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 10:53 [PATCH v5 0/6] wifi: rtw88: preparations for RTL8723B/RTL8723BS luka.gejak
2026-08-14 10:53 ` [PATCH v5 1/6] wifi: rtw88: add the RTL8723B chip type and SDIO helper luka.gejak
2026-08-14 10:53 ` [PATCH v5 2/6] wifi: rtw88: rx: mark zero length packets on RTL8723BS luka.gejak
2026-08-19  0:41   ` Ping-Ke Shih
2026-08-14 10:53 ` [PATCH v5 3/6] wifi: rtw88: tx: extend the TX report purge timeout to RTL8723BS luka.gejak
2026-08-14 10:53 ` [PATCH v5 4/6] wifi: rtw88: sdio: track free TX pages and OQT credits for RTL8723BS luka.gejak
2026-08-19  0:52   ` Ping-Ke Shih
2026-08-14 10:53 ` [PATCH v5 5/6] wifi: rtw88: sdio: set up RX aggregation and interrupts " luka.gejak
2026-08-19  0:56   ` Ping-Ke Shih
2026-08-14 10:53 ` [PATCH v5 6/6] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation luka.gejak
2026-08-19  1:14   ` Ping-Ke Shih [this message]
2026-08-19  7:19     ` Luka Gejak
2026-08-19  7:31       ` Ping-Ke Shih
2026-08-19  9:17         ` Luka Gejak
2026-08-19  0:44 ` [PATCH v5 0/6] wifi: rtw88: preparations for RTL8723B/RTL8723BS Ping-Ke Shih
2026-08-19  7:19   ` [PATCH v5 0/6] wifi: rtw88: preparations for RTL8723B/RTL8723BS support 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=257b9af907e84e439ae6a9fd55bf3f09@realtek.com \
    --to=pkshih@realtek.com \
    --cc=johannes.goede@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luka.gejak@linux.dev \
    --cc=pbrobinson@gmail.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