[PATCH rtw-next v3 5/5] wifi: rtw88: clear the restart flag when the device is stopped
From: Mehmet Fide
Date: Tue Nov 17 2026 - 12:10:49 EST
From: Mehmet Fide <mehmet.fide@xxxxxxxxxxxxxxxxxx>
The firmware recovery sets RTW_FLAG_RESTARTING, and rtw_reconfig_complete()
clears it once mac80211 has restarted the hardware. If the last interface
goes down before the restart work runs, ieee80211_reconfig() finds no open
interface and does not call reconfig_complete(), so the flag is still set
when an interface comes up again. rtw_fw_recovery() then ignores every
later firmware crash, and writing the fw_crash debugfs file returns
-EINPROGRESS.
Clear the flag in rtw_ops_stop(). mac80211 does not stop the device while
it restarts it, so a stop leaves no restart to wait for.
Reported-by: Luka Gejak <luka.gejak@xxxxxxxxx>
Closes: https://lore.kernel.org/linux-wireless/5285DA11-651F-4286-A0FD-52A6051B3A88@xxxxxxxxx/
Fixes: 5c831644e1f4 ("rtw88: handle and recover when firmware crash")
Signed-off-by: Mehmet Fide <mehmet.fide@xxxxxxxxxxxxxxxxxx>
---
Notes:
v3: new (Luka Gejak)
drivers/net/wireless/realtek/rtw88/mac80211.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 5e40cf06a9e3..10f1ae08f383 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -68,6 +68,7 @@ static void rtw_ops_stop(struct ieee80211_hw *hw, bool suspend)
mutex_lock(&rtwdev->mutex);
rtw_core_stop(rtwdev);
+ clear_bit(RTW_FLAG_RESTARTING, rtwdev->flags);
mutex_unlock(&rtwdev->mutex);
}
--
2.56.0