public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 v2 5/7] wifi: rtw89: implement C2H TX report handler
Date: Tue, 7 Oct 2025 03:13:08 +0000	[thread overview]
Message-ID: <91083b4683fd457ab6363b135bfee6a3@realtek.com> (raw)
In-Reply-To: <20251002200857.657747-6-pchelkin@ispras.ru>

Fedor Pchelkin <pchelkin@ispras.ru> wrote:
> rtw89 has several ways of handling TX status report events.  The first one
> is based on RPP feature which is used by PCIe HCI.  The other one depends
> on firmware sending a corresponding C2H message, quite similar to what
> rtw88 has.
> 
> Toggle a bit in the TX descriptor and place skb in a queue to wait for a
> message from the firmware.  rtw89 has an extra feature providing TX
> reports for multiple retry transmission attempts.  When there is a failed
> TX status reported by the firmware, the report is ignored until the limit
> is reached or success status appears.  Do all this according to the vendor
> driver for RTL8851BU.
> 
> It seems the only way to implement TX status reporting for rtw89 USB.
> This will allow handling TX wait skbs and the ones flagged with
> IEEE80211_TX_CTL_REQ_TX_STATUS correctly.
> 
> Found by Linux Verification Center (linuxtesting.org).
> 
> Suggested-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 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 fd11b8fb3c89..10c2a39e544b 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -5457,6 +5457,20 @@ rtw89_mac_c2h_mcc_status_rpt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32
>         rtw89_complete_cond(&rtwdev->mcc.wait, cond, &data);
>  }
> 
> +static void
> +rtw89_mac_c2h_tx_rpt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len)
> +{
> +       const struct rtw89_c2h_mac_tx_rpt *rpt =
> +               (const struct rtw89_c2h_mac_tx_rpt *)c2h->data;
> +       u8 sw_define = le32_get_bits(rpt->w2, RTW89_C2H_MAC_TX_RPT_W2_SW_DEFINE);
> +       u8 tx_status = le32_get_bits(rpt->w2, RTW89_C2H_MAC_TX_RPT_W2_TX_STATE);
> +       u8 data_txcnt = le32_get_bits(rpt->w5, RTW89_C2H_MAC_TX_RPT_W5_DATA_TX_CNT);

Since we'd like reverse X'mas tree order, I'd like separate declarations and
assignments. Like

u8 sw_define, tx_status, data_txcnt;

sw_define = le32_get_bits(rpt->w2, RTW89_C2H_MAC_TX_RPT_W2_SW_DEFINE);
tx_status = le32_get_bits(rpt->w2, RTW89_C2H_MAC_TX_RPT_W2_TX_STATE);
data_txcnt = le32_get_bits(rpt->w5, RTW89_C2H_MAC_TX_RPT_W5_DATA_TX_CNT);

Otherwise, looks good to me.

> +
> +       rtw89_debug(rtwdev, RTW89_DBG_TXRX,
> +                   "C2H TX RPT: sn %d, tx_status %d, data_txcnt %d\n",
> +                   sw_define, tx_status, data_txcnt);
> +}
> +

[...]


  reply	other threads:[~2025-10-07  3:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02 20:08 [PATCH rtw-next v2 0/7] wifi: rtw89: improvements for USB part Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 1/7] wifi: rtw89: usb: use common error path for skbs in rtw89_usb_rx_handler() Fedor Pchelkin
2025-10-07  2:46   ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 2/7] wifi: rtw89: usb: fix leak in rtw89_usb_write_port() Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 3/7] wifi: rtw89: usb: use ieee80211_free_txskb() where appropriate Fedor Pchelkin
2025-10-07  2:51   ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 4/7] wifi: rtw89: refine rtw89_core_tx_wait_complete() Fedor Pchelkin
2025-10-07  2:54   ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 5/7] wifi: rtw89: implement C2H TX report handler Fedor Pchelkin
2025-10-07  3:13   ` Ping-Ke Shih [this message]
2025-10-02 20:08 ` [PATCH rtw-next v2 6/7] wifi: rtw89: handle IEEE80211_TX_CTL_REQ_TX_STATUS frames for USB Fedor Pchelkin
2025-10-07  6:31   ` Ping-Ke Shih
2025-10-14 21:23     ` Fedor Pchelkin
2025-10-15  1:43       ` Ping-Ke Shih
2025-10-15  7:51         ` Fedor Pchelkin
2025-10-16  0:54           ` Ping-Ke Shih
2025-10-17 10:06             ` Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 7/7] wifi: rtw89: process TX wait skbs for USB via C2H handler Fedor Pchelkin
2025-10-03  2:23   ` Zong-Zhe Yang
2025-10-07  8:07   ` Ping-Ke Shih
2025-10-11 16:06     ` Fedor Pchelkin
2025-10-13  0:59       ` Ping-Ke Shih
2025-10-04 17:37 ` [PATCH rtw-next v2 0/7] wifi: rtw89: improvements for USB part Bitterblue Smith
2025-10-11 14:57   ` Fedor Pchelkin
2025-10-11 22:49     ` Bitterblue Smith
2025-10-14 21:33       ` Fedor Pchelkin
2025-10-20 13:52         ` Bitterblue Smith

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=91083b4683fd457ab6363b135bfee6a3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox