public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb
@ 2025-04-24 12:38 Ladislav Michl
  2025-04-25  1:14 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Ladislav Michl @ 2025-04-24 12:38 UTC (permalink / raw)
  To: stable; +Cc: Ping-Ke Shih

From: Ladislav Michl <ladis@triops.cz>

corresponding upstream commit 3e5e4a801aaf4283390cc34959c6c48f910ca5ea

When removing kernel modules 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.

As upstream commit mentioned above does not apply on linux-6.1.y tree
it has been rewritten.

  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 4072 at net/mac80211/main.c:1506 ieee80211_free_ack_frame+0x74/0xa0 [mac80211]
  Have pending ack frames!
  Modules linked in: rtw88_8822ce rtw88_8822c rtw88_pci rtw88_core mac80211 libarc4 cfg80211 qmi_wwan usbnet mii cdc_acm [last unloaded: cfg80211]
  CPU: 0 PID: 4072 Comm: sh Not tainted 6.1.104 #2
  Stack : 0000000000000000 000000000000068d 0000000000000008 000b24caa995d315
          000b24caa995d315 0000000000000000 8000000002813958 ffffffff818f4a30
          ffffffff81a673c8 0000000000000001 0000000000000001 0000000000000000
          00000000000817bd 0000000000000010 ffffffff817f3720 0000000000000002
          800000000281384f ffffffff81a20000 ffffffff818f4a30 0000000000000009
          ffffffff81a20000 8000000003a41df8 ffffffff81a20000 0000000000000001
          8000000002651570 8000000082813847 ffffffff8143a6c0 0000000000000000
          ffffffff81b10000 8000000002810000 8000000002813950 0000000000000030
          ffffffff817ca460 0000000000000000 ffffffff818f4a30 ffffffff817ca3e0
          0000000000000001 ffffffff818f4a30 ffffffff811198b8 0000000000000000
        ...
  Call Trace:
  [<ffffffff811198b8>] show_stack+0x38/0x118
  [<ffffffff817ca460>] dump_stack_lvl+0x30/0x54
  [<ffffffff81130f6c>] __warn+0x9c/0xe4
  [<ffffffff81131054>] warn_slowpath_fmt+0xa0/0xd4
  [<ffffffffc02770ec>] ieee80211_free_ack_frame+0x74/0xa0 [mac80211]
  [<ffffffff817ccfd8>] idr_for_each+0x88/0x150
  [<ffffffffc0277538>] ieee80211_free_hw+0x48/0xf8 [mac80211]
  [<ffffffff813f2a54>] pci_device_remove+0x2c/0x78
  [<ffffffff8144c7dc>] device_release_driver_internal+0x1e4/0x288
  [<ffffffff813e8998>] pci_stop_bus_device+0x88/0xb8
  [<ffffffff813e8a84>] pci_stop_and_remove_bus_device_locked+0x1c/0x38
  [<ffffffff813f52d0>] remove_store+0xa0/0xb0
  [<ffffffff81279be4>] kernfs_fop_write_iter+0x10c/0x230
  [<ffffffff811fc49c>] vfs_write+0x1cc/0x388
  [<ffffffff811fc7f8>] ksys_write+0x78/0x120
  [<ffffffff81121420>] syscall_common+0x34/0x58
  ---[ end trace 0000000000000000 ]---

Cc: stable@vger.kernel.org # 6.1.x: 53bc1b7: wifi: mac80211: export ieee80211_purge_tx_queue() for drivers
Cc: stable@vger.kernel.org # 6.1.x
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 drivers/net/wireless/realtek/rtw88/main.c | 2 +-
 drivers/net/wireless/realtek/rtw88/tx.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 4620a0d5c77b..7c390c2c608d 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2146,7 +2146,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);
 
diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
index ab39245e9c2f..05e6911a4044 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -169,7 +169,7 @@ void rtw_tx_report_purge_timer(struct timer_list *t)
 	rtw_warn(rtwdev, "failed to get tx report from firmware\n");
 
 	spin_lock_irqsave(&tx_report->q_lock, flags);
-	skb_queue_purge(&tx_report->queue);
+	ieee80211_purge_tx_queue(rtwdev->hw, &tx_report->queue);
 	spin_unlock_irqrestore(&tx_report->q_lock, flags);
 }
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-25  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-24 12:38 [PATCH] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb Ladislav Michl
2025-04-25  1:14 ` Sasha Levin
2025-04-25  7:18   ` Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox