public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Ladislav Michl <oss-lists@triops.cz>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org,
	pbrobinson@gmail.com
Subject: Re: [PATCH v2 2/2] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb
Date: Tue, 5 Nov 2024 11:54:17 +0100	[thread overview]
Message-ID: <Zyn5WcUGoibH7-s8@lenoch> (raw)
In-Reply-To: <20240822014255.10211-2-pkshih@realtek.com>

On Thu, Aug 22, 2024 at 09:42:55AM +0800, Ping-Ke Shih wrote:
> When removing kernel modules by:
>    rmmod rtw88_8723cs rtw88_8703b rtw88_8723x rtw88_sdio rtw88_core
> 
> Driver uses skb_queue_purge() to purge TX skb, but not report tx status
> causing "Have pending ack frames!" warning. Use ieee80211_purge_tx_queue()
> to correct this.
> 
> Since ieee80211_purge_tx_queue() doesn't take locks, to prevent racing
> between TX work and purge TX queue, flush and destroy TX work in advance.

A the very same problem exists in 6.1 kernel series, where this patch
becomes oneliner:
---
 drivers/net/wireless/realtek/rtw88/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 81f3112923f1..d7d4b0f05da9 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2145,7 +2145,7 @@ void rtw_core_deinit(struct rtw_dev *rtwdev)
 
 	destroy_workqueue(rtwdev->tx_wq);
 	spin_lock_irqsave(&rtwdev->tx_report.q_lock, flags);
-	skb_queue_purge(&rtwdev->tx_report.queue);
+	ieee80211_purge_tx_queue(rtwdev->hw, &rtwdev->tx_report.queue);
 	skb_queue_purge(&rtwdev->coex.queue);
 	spin_unlock_irqrestore(&rtwdev->tx_report.q_lock, flags);
 
-- 
2.39.5

  parent reply	other threads:[~2024-11-05 10:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  1:42 [PATCH v2 1/2] wifi: mac80211: export ieee80211_purge_tx_queue() for drivers Ping-Ke Shih
2024-08-22  1:42 ` [PATCH v2 2/2] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb Ping-Ke Shih
2024-08-22  1:48   ` Ping-Ke Shih
2024-09-20  6:27   ` Ping-Ke Shih
2024-09-20  6:33   ` Ping-Ke Shih
2024-09-20 12:58     ` Bitterblue Smith
2024-09-20 13:11       ` Ping-Ke Shih
2024-09-20 14:44         ` Bitterblue Smith
2024-11-05 10:54   ` Ladislav Michl [this message]
2024-11-06  3:43     ` Ping-Ke Shih
2024-11-06  9:33       ` Ladislav Michl
2024-11-07  0:17         ` 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=Zyn5WcUGoibH7-s8@lenoch \
    --to=oss-lists@triops.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=pkshih@realtek.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