From: Ping-Ke Shih <pkshih@realtek.com>
To: "5mghybrid@khu.ac.kr" <5mghybrid@khu.ac.kr>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Jes.Sorensen@gmail.com" <Jes.Sorensen@gmail.com>
Subject: RE: [PATCH rtw-next v3 3/3] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
Date: Sun, 20 Sep 2026 03:46:55 +0000 [thread overview]
Message-ID: <9b5c31541fc8430b9d4205dcdff9e76e@realtek.com> (raw)
In-Reply-To: <20260920-codex-rtl-rx-v3-submit-v3-3-883d11351963@khu.ac.kr>
Kim Wooseok via B4 Relay <devnull+5mghybrid.khu.ac.kr@kernel.org> wrote:
[...]
> @@ -5855,9 +5856,8 @@ static int rtl8xxxu_alloc_rx_urbs(struct rtl8xxxu_priv *priv)
> }
>
> static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
> - struct rtl8xxxu_rx_urb *rx_urb)
> + struct rtl8xxxu_rx_urb *rx_urb, bool retry)
'retry' --> 'defer_schedule'?
> {
> - struct sk_buff *skb;
> unsigned long flags;
>
> spin_lock_irqsave(&priv->rx_urb_lock, flags);
> @@ -5865,16 +5865,13 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
> if (!priv->shutdown) {
> list_add_tail(&rx_urb->list, &priv->rx_urb_pending_list);
> priv->rx_urb_pending_count++;
> - /*
> - * Arm the worker under rx_urb_lock so this is atomic with the
> - * shutdown check: moving it out of the lock would let a
> - * completion arm the work after rtl8xxxu_stop() canceled it.
> - */
> - if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
> - schedule_work(&priv->rx_urb_wq);
> + /* Serialize scheduling with the shutdown check and cancellation. */
> + if (retry)
> + queue_delayed_work(system_wq, &priv->rx_urb_wq,
> + msecs_to_jiffies(RTL8XXXU_RX_URB_RETRY_DELAY_MS));
> + else if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
> + mod_delayed_work(system_wq, &priv->rx_urb_wq, 0);
Not prefer using bare system_wq.
Can both use schedule_delayed_work()?
> } else {
> - skb = (struct sk_buff *)rx_urb->urb.context;
> - dev_kfree_skb_irq(skb);
> usb_free_urb(&rx_urb->urb);
> }
>
[...]
> @@ -6585,10 +6583,23 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
>
> skb = NULL;
> rx_urb->urb.context = NULL;
> - rtl8xxxu_queue_rx_urb(priv, rx_urb);
> + rtl8xxxu_queue_rx_urb(priv, rx_urb, false);
> } else {
> dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
nit: a blank line
> - goto cleanup;
> + switch (urb->status) {
> + case -EPROTO:
> + case -EILSEQ:
> + case -ETIME:
> + case -EOVERFLOW:
> + case -ECOMM:
> + case -ENOSR:
> + dev_kfree_skb(skb);
> + urb->context = NULL;
> + rtl8xxxu_queue_rx_urb(priv, rx_urb, true);
> + return;
> + default:
> + goto cleanup;
> + }
> }
> return;
>
[...]
next prev parent reply other threads:[~2026-09-20 3:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 20:44 [PATCH rtw-next v3 0/3] wifi: rtl8xxxu: keep RX requests available across transient errors Kim Wooseok via B4 Relay
2026-09-19 20:44 ` Kim Wooseok
2026-09-19 20:44 ` [PATCH rtw-next v3 1/3] wifi: rtl8xxxu: free RX skb when URB submission fails Kim Wooseok via B4 Relay
2026-09-19 20:44 ` Kim Wooseok
2026-09-19 20:44 ` [PATCH rtw-next v3 2/3] wifi: rtl8xxxu: unwind incomplete receive startup Kim Wooseok via B4 Relay
2026-09-19 20:44 ` Kim Wooseok
2026-09-20 3:26 ` Ping-Ke Shih
2026-09-20 8:17 ` Kim Wooseok
2026-09-19 20:44 ` [PATCH rtw-next v3 3/3] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Kim Wooseok via B4 Relay
2026-09-19 20:44 ` Kim Wooseok
2026-09-20 3:46 ` Ping-Ke Shih [this message]
2026-09-20 8:17 ` Kim Wooseok
2026-09-21 0:24 ` Ping-Ke Shih
2026-09-21 7:58 ` Kim Wooseok
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=9b5c31541fc8430b9d4205dcdff9e76e@realtek.com \
--to=pkshih@realtek.com \
--cc=5mghybrid@khu.ac.kr \
--cc=Jes.Sorensen@gmail.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.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.