[PATCH ath-next v3 00/13] wifi: ath11k: firmware crash recovery fixes

From: Julius Bairaktaris

Date: Sat Nov 21 2026 - 18:07:44 EST


Firmware crash recovery on IPQ8074 resets a waitqueue under a sleeping
WMI sender (1/13), frees radios and ring memory still in use when it
fails (2/13, 3/13), sends on rings it has not rebuilt yet (4/13), and
lets cfg80211 commands crash the restarting firmware again (5/13).

6/13 to 8/13 are Florian Maurer's AHB recovery fixes [1], kept with his
authorship and sign-off: ext IRQs disabled twice after a failed
recovery, the RPMSG Kconfig dependency the SSR notifier needs, and TX
stopped in the QCOM_SSR_BEFORE_SHUTDOWN notification.

9/13 to 11/13 fix error and teardown paths of the QMI service and the
AHB probe that the following patch relies on. 12/13 stops the restart
work of an earlier crash before remoteproc takes WCSS down: a crash
while that work sets up the rings ends in an asynchronous SError, and a
restart work that outlives its firmware waits for the dead firmware and
then talks to the next one. 13/13 keeps the thermal cooling devices
across a recovery.

Tested on a Xiaomi AX3600 (IPQ8074 hw2.0, firmware
WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1) running both radios as APs,
with the series on OpenWrt's 6.18 kernel and wireless backports. One
run crashes the firmware once through simulate_fw_crash; eight more
force a second crash through the remoteproc debugfs "crash" file at
growing delays after "remote processor q6wcss is now up", so that it
arrives before the QMI handshake, while the host capabilities are sent,
during the board file download, during the ring setup and during the
mac80211 reconfiguration. In all nine runs the router kept running, both
radios came back and the firmware took the next simulate_fw_crash
command; stations were associated again after the last run. In the run
whose second crash arrives during ieee80211_reconfig(), mac80211 warns
once in ieee80211_reconfig_stations(), as the station state cannot be
set while the firmware is down, and the restart that follows recovers.
After the 17 crashes both cooling devices are still registered and the
hwmon temperatures read.

I used Claude (Anthropic) to help write these patches.

v3:
- 2/13: also leave the mac80211 registration and the debugfs tree alone
in the error path of ath11k_core_pdev_create() during a recovery
(found in review).
- 3/13: Baochen Qiang pointed out on v1 that testing HAL srng fields in
the CE layer is a layer violation. A recovery that fails before
ath11k_ce_init_pipes() still leaves the CE rings zeroed, and Florian
reproduced the resulting NULL dereference in ath11k_ce_cleanup_pipes()
on v2. The ring state is now core state: ATH11K_FLAG_CE_RINGS_SETUP is
set after ath11k_ce_init_pipes() and cleared where
ath11k_hal_srng_clear() zeroes the rings, and ath11k_ce_cleanup_pipes()
returns while it is clear. The rx_replenish_retry timer is stopped
before the CE cleanup, and ath11k_ce_send() tests CRASH_FLUSH before it
reaps a ring.
- 4/13: the error path sets CRASH_FLUSH again before ath11k_dp_free();
the QMI FW_READY handler clears CRASH_FLUSH only on the first boot
(found in review).
- 5/13: RECOVERY is tested on every try of the send loops, the CE
descriptor waiters are woken when the recovery starts, and FW_READY
clears RECOVERY only on the first boot (found in review).
- 6/13 to 8/13: new, Florian Maurer's series [1].
- 9/13: new, the QMI handle leaked when the QMI service init fails
(found in review).
- 10/13: new, a failing IRQ setup in the AHB probe left the booted
firmware and the QMI client behind (found in review).
- 11/13: new, queued QMI events leaked at teardown (found in review).
- 12/13: new; an earlier version gated the register accessors while WCSS
was down, which review showed left the restart work running into the
next firmware.
- 13/13: new, the cooling devices were unregistered on every recovery
and never registered again.
- Rebased on ath-next.

v2: https://lore.kernel.org/r/20261018210153.1925962-1-julius@xxxxxxxxxxxxxx
v1: https://lore.kernel.org/r/20260805192129.61113-1-julius@xxxxxxxxxxxxxx
[1] https://lore.kernel.org/r/cover.1793531790.git.fmaurer@xxxxxxxxxxx

Florian Maurer (3):
wifi: ath11k: don't disable ext IRQs twice
wifi: ath11k: depend on RPMSG instead of selecting it
wifi: ath11k: ahb: stop TX before WCSS is reset on a firmware crash

Julius Bairaktaris (10):
wifi: ath11k: initialise the CE descriptor waitqueue once per device
wifi: ath11k: keep the radios when a firmware recovery fails
wifi: ath11k: keep the srng allocations when a firmware recovery fails
wifi: ath11k: clear CRASH_FLUSH only after recovery rebuilds the rings
wifi: ath11k: hold back WMI commands while the firmware restarts
wifi: ath11k: release the QMI handle when the QMI service init fails
wifi: ath11k: ahb: configure the IRQs before the firmware is booted
wifi: ath11k: free the queued QMI events when the QMI service is torn
down
wifi: ath11k: stop the restart work before WCSS goes down
wifi: ath11k: keep the cooling device across a firmware recovery

drivers/net/wireless/ath/ath11k/Kconfig | 3 +-
drivers/net/wireless/ath/ath11k/ahb.c | 135 +++++++-
drivers/net/wireless/ath/ath11k/ahb.h | 4 +
drivers/net/wireless/ath/ath11k/ce.c | 16 +-
drivers/net/wireless/ath/ath11k/core.c | 114 ++++++-
drivers/net/wireless/ath/ath11k/core.h | 5 +
drivers/net/wireless/ath/ath11k/dp_tx.c | 11 +-
drivers/net/wireless/ath/ath11k/htc.c | 22 +-
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath11k/pcic.c | 4 +-
drivers/net/wireless/ath/ath11k/qmi.c | 391 ++++++++++++++++++++----
drivers/net/wireless/ath/ath11k/qmi.h | 38 ++-
drivers/net/wireless/ath/ath11k/wmi.c | 44 ++-
13 files changed, 672 insertions(+), 116 deletions(-)


base-commit: 1983b40acfcb3c3464b291c85977290a785bcfdc
--
2.53.0