1: 7fa8fad0490b ! 1: c3d9922e2b51 wifi: ath11k: initialise the CE descriptor waitqueue once per device @@ Commit message  Initialise the queues once in ath11k_core_alloc().  - Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 + Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1  Fixes: f951380a6022 ("ath11k: Disabling credit flow for WMI path") Reviewed-by: Baochen Qiang  - Assisted-by: Claude:claude-opus-5-5 + Tested-by: Florian Maurer # IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146 (backport to 6.18) Signed-off-by: Julius Bairaktaris   ## drivers/net/wireless/ath/ath11k/core.c ##  2: 1c8fafc1ae06 ! 2: 7e66afa95b6a wifi: ath11k: keep the radios when a firmware recovery fails @@ Commit message Destroy the radios only when ATH11K_FLAG_REGISTERED is clear, as ath11k_mac_allocate() does.  - Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 + ath11k_core_pdev_create() has the same problem with the registration. + During a recovery ath11k_mac_register() and ath11k_debugfs_pdev_create() + return early, but when a later step such as ath11k_spectral_init() or + ath11k_cfr_init() fails, the error path calls ath11k_mac_unregister() + and ath11k_debugfs_pdev_destroy(). The first unregisters the radios + from mac80211 while ATH11K_FLAG_REGISTERED stays set, so driver removal + unregisters them a second time. The second removes the debugfs tree of + the device with the macN directories, while ar->debug.debugfs_pdev + keeps pointing to the removed directory; the next recovery's + ath11k_spectral_init() and ath11k_cfr_init() create their files under + it. Undo both there only when ATH11K_FLAG_REGISTERED is clear as well, + which is when this call did them. + + Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1  Fixes: 0366f42640a4 ("ath11k: Move mac80211 hw allocation before wmi_init command") - Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julius Bairaktaris   ## drivers/net/wireless/ath/ath11k/core.c ## +@@ drivers/net/wireless/ath/ath11k/core.c: static int ath11k_core_pdev_create(struct ath11k_base *ab) + err_thermal_unregister: + ath11k_thermal_unregister(ab); + err_mac_unregister: +- ath11k_mac_unregister(ab); ++ if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) ++ ath11k_mac_unregister(ab); + err_dp_pdev_free: + ath11k_dp_pdev_free(ab); + err_pdev_debug: +- ath11k_debugfs_pdev_destroy(ab); ++ if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) ++ ath11k_debugfs_pdev_destroy(ab); +  + return ret; + }  @@ drivers/net/wireless/ath/ath11k/core.c: static int ath11k_core_start(struct ath11k_base *ab) err_reo_cleanup: ath11k_dp_pdev_reo_cleanup(ab);  3: 493ec38c5e50 < -: ------------ wifi: ath11k: keep the srng allocations when a firmware recovery fails  -: ------------ > 3: f1316658f548 wifi: ath11k: keep the srng allocations when a firmware recovery fails  4: 83d6bf345a5f ! 4: b6b70f4bc82d wifi: ath11k: clear CRASH_FLUSH only after recovery rebuilds the rings @@ Commit message Clear the flag once the rings are rebuilt, before ath11k_core_start() sends the first HTC message.  - Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 + If ath11k_core_start() or ath11k_core_pdev_create() then fails, the error + path frees the data path rings with the flag clear. The stations stay in + ab->peers, so removing one later, or removing the driver, makes + ath11k_dp_tx_send_reo_cmd() write a REO command into the freed REO + command ring. Set the flag again before ath11k_dp_free(). + + On targets that do not restart the firmware after the cold boot + calibration, the QMI FW_READY handler clears the flag as well, also + during a recovery. FW_READY follows the firmware start, so it arrives + while the restart work is still rebuilding the rings. Clear the flag + there only on the first boot, before that handler starts the firmware + itself. + + Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1  Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") - Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julius Bairaktaris   ## drivers/net/wireless/ath/ath11k/core.c ## @@ drivers/net/wireless/ath/ath11k/core.c: int ath11k_core_qmi_firmware_ready(struc if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW) set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);  +@@ drivers/net/wireless/ath/ath11k/core.c: int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab) + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_mac_destroy(ab); + err_dp_free: ++ set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); + ath11k_dp_free(ab); + mutex_unlock(&ab->core_lock); + err_firmware_stop:  @@ drivers/net/wireless/ath/ath11k/core.c: static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)  ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - 1; @@ drivers/net/wireless/ath/ath11k/core.c: static int ath11k_core_reconfigure_on_cr ret = ath11k_core_qmi_firmware_ready(ab); if (ret) return ret; + + ## drivers/net/wireless/ath/ath11k/qmi.c ## +@@ drivers/net/wireless/ath/ath11k/qmi.c: static void ath11k_qmi_driver_event_work(struct work_struct *work) + if (ab->hw_params.cbcal_restart_fw) + break; +  +- clear_bit(ATH11K_FLAG_CRASH_FLUSH, +- &ab->dev_flags); + clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { ++ clear_bit(ATH11K_FLAG_CRASH_FLUSH, ++ &ab->dev_flags); + ret = ath11k_core_qmi_firmware_ready(ab); + if (ret) { + set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags);  5: a8c6caec4c5c < -: ------------ wifi: ath11k: hold back WMI commands while the firmware restarts  -: ------------ > 5: 5b436868945f wifi: ath11k: hold back WMI commands while the firmware restarts  -: ------------ > 6: 025157e12701 wifi: ath11k: don't disable ext IRQs twice  -: ------------ > 7: 184494d2117a wifi: ath11k: depend on RPMSG instead of selecting it  -: ------------ > 8: 04029e155251 wifi: ath11k: ahb: stop TX before WCSS is reset on a firmware crash  -: ------------ > 9: edf82d94fce4 wifi: ath11k: release the QMI handle when the QMI service init fails  -: ------------ > 10: a79cc0d1c4e9 wifi: ath11k: ahb: configure the IRQs before the firmware is booted  -: ------------ > 11: 3a41ba5a6e31 wifi: ath11k: free the queued QMI events when the QMI service is torn down  -: ------------ > 12: 78a27500a2b8 wifi: ath11k: stop the restart work before WCSS goes down  -: ------------ > 13: d6417170b6af wifi: ath11k: keep the cooling device across a firmware recovery