From: Ping-Ke Shih <pkshih@realtek.com>
To: Fedor Pchelkin <pchelkin@ispras.ru>,
Bitterblue Smith <rtl8821cerfe2@gmail.com>
Cc: Zong-Zhe Yang <kevin_yang@realtek.com>,
Bernie Huang <phhuang@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>
Subject: RE: [PATCH rtw-next 5/6] wifi: rtw89: process TX wait skbs for USB via C2H handler
Date: Thu, 25 Sep 2025 03:39:14 +0000 [thread overview]
Message-ID: <c2c40bed311c4f05948cf2541c64ea30@realtek.com> (raw)
In-Reply-To: <20250920132614.277719-6-pchelkin@ispras.ru>
Fedor Pchelkin <pchelkin@ispras.ru> wrote:
> TX wait skbs need to be completed when they are done. PCIe part does this
> inside rtw89_pci_tx_status() during RPP processing. Other HCIs use a
> mechanism based on C2H firmware messages.
>
> Store a sequence number in a TX wait object so that it'll be possible to
> identify completed items inside C2H handler. No need to add the
> corresponding skb to the &txcb->tx_ack_queue on USB part.
>
> Found by Linux Verification Center (linuxtesting.org).
>
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
[...]
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 831e53aedccc..79409eb4d028 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -5477,6 +5477,7 @@ rtw89_mac_c2h_tx_rpt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len)
> {
> u8 sw_define = RTW89_GET_MAC_C2H_TX_RPT_SW_DEFINE(c2h->data);
> u8 tx_status = RTW89_GET_MAC_C2H_TX_RPT_TX_STATE(c2h->data);
> + struct rtw89_tx_wait_info *wait;
> struct sk_buff *cur, *tmp;
> unsigned long flags;
> u8 *n;
> @@ -5485,6 +5486,16 @@ rtw89_mac_c2h_tx_rpt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len)
> "C2H TX RPT: sn %d, tx_status %d\n",
> sw_define, tx_status);
>
> + rcu_read_lock();
> + list_for_each_entry_rcu(wait, &rtwdev->tx_waits, list) {
> + if (wait->sn == sw_define) {
> + wait->tx_done = tx_status == RTW89_TX_DONE;
> + complete_all(&wait->completion);
> + break;
> + }
> + }
> + rcu_read_unlock();
> +
Since we can get 'wait' from RTW89_TX_SKB_CB(), can we just use
rtwdev->tx_rpt_queue?
Also, call rtw89_core_tx_wait_complete() to complete wait?
> spin_lock_irqsave(&rtwdev->tx_rpt_queue.lock, flags);
> skb_queue_walk_safe(&rtwdev->tx_rpt_queue, cur, tmp) {
> n = (u8 *)RTW89_TX_SKB_CB(cur)->hci_priv;
next prev parent reply other threads:[~2025-09-25 3:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-20 13:26 [PATCH rtw-next 0/6] wifi: rtw89: improvements for USB part Fedor Pchelkin
2025-09-20 13:26 ` [PATCH rtw-next 1/6] wifi: rtw89: usb: fix leak in rtw89_usb_rx_handler() Fedor Pchelkin
2025-09-24 8:49 ` Ping-Ke Shih
2025-09-20 13:26 ` [PATCH rtw-next 2/6] wifi: rtw89: usb: fix leak in rtw89_usb_write_port() Fedor Pchelkin
2025-09-24 9:03 ` Ping-Ke Shih
2025-09-29 9:12 ` Fedor Pchelkin
2025-09-30 2:03 ` Ping-Ke Shih
2025-09-20 13:26 ` [PATCH rtw-next 3/6] wifi: rtw89: implement C2H TX report handler Fedor Pchelkin
2025-09-23 22:12 ` Bitterblue Smith
2025-09-24 19:16 ` Bitterblue Smith
2025-09-29 9:46 ` Fedor Pchelkin
2025-09-24 9:18 ` Ping-Ke Shih
2025-09-20 13:26 ` [PATCH rtw-next 4/6] wifi: rtw89: handle IEEE80211_TX_CTL_REQ_TX_STATUS frames for USB Fedor Pchelkin
2025-09-25 2:05 ` Ping-Ke Shih
2025-09-29 14:16 ` Fedor Pchelkin
2025-09-30 1:55 ` Ping-Ke Shih
2025-09-20 13:26 ` [PATCH rtw-next 5/6] wifi: rtw89: process TX wait skbs for USB via C2H handler Fedor Pchelkin
2025-09-25 3:39 ` Ping-Ke Shih [this message]
2025-09-20 13:26 ` [PATCH rtw-next 6/6] wifi: rtw89: forcefully clear TX wait list on HCI reset Fedor Pchelkin
2025-09-25 3:50 ` Ping-Ke Shih
2025-09-22 5:45 ` [PATCH rtw-next 0/6] wifi: rtw89: improvements for USB part 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=c2c40bed311c4f05948cf2541c64ea30@realtek.com \
--to=pkshih@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=pchelkin@ispras.ru \
--cc=phhuang@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 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.