Re: [PATCH rtw-next v2 3/3] wifi: rtw88: reset the stations outside of RCU on firmware recovery
From: Luka Gejak
Date: Mon Nov 16 2026 - 10:55:59 EST
Hi Mehmet,
Thanks for the update. One comment below.
On November 16, 2026 8:20:14 AM GMT+01:00, Mehmet Fide
<mehmet.fide@xxxxxxxxx> wrote:
> @@ -664,7 +664,7 @@ static void __fw_recovery_work(struct rtw_dev *rtwdev)
> WARN(1, "firmware crash, start reset and recover\n");
>
> rtw_iterate_keys_atomic(rtwdev, NULL, rtw_reset_key_iter, rtwdev);
> - rtw_iterate_stas_atomic(rtwdev, rtw_reset_sta_iter, rtwdev);
> + rtw_iterate_stas(rtwdev, rtw_reset_sta_iter, rtwdev);
> rtw_iterate_vifs_atomic(rtwdev, rtw_reset_vif_iter, rtwdev);
I followed the allocation failure case from v1 a bit further:
https://lore.kernel.org/r/699D1E7C-1793-44A7-AF57-CFE16AD036E6@xxxxxxxxx/
As far as I can see, skipping a station also skips rtw_txq_cleanup().
For a queue outside the voice access category, wake_tx_queue() queues
tx_work. If that work has not run yet, the omitted station's queue can
stay on rtwdev->txqs until reconfiguration. rtw_sta_add() then calls
rtw_txq_init(), which does this without unlinking it:
INIT_LIST_HEAD(&rtwtxq->list);
The device list still points at that node, but the node now points to
itself. __rtw_tx_work() seems to keep visiting it while holding
txq_lock. Its list_del_init() cannot repair the device list because
the node has already lost its old links.
rtw_enter_ips() does not drain rtwdev->tx_wq, and the flush in
ieee80211_restart_work() is of mac80211's separate workqueue. So I think
this can hang the TX worker, beyond the station count and MAC ID leak
I mentioned before.
Could recovery use an iteration that cannot silently skip stations?
Best regards,
Luka Gejak