wifi: ath12k: fixes to improve MLO station stability
v2 cover wifi: ath12k: fixes to improve MLO station stability
This series improves firmware crash recovery and connection stability for MLO (Wi-Fi 7) stations on ath12k. Both work correctly for non-MLO (Wi-Fi 6) stations, where the driver handles the full teardown and reconnect cycle without issues and maintains stable connections. This series brings MLO to the same level.
Without these fixes, a firmware crash during an active MLO connection results in kernel warnings, NULL pointer dereferences, 20+ second recovery delays, and periodic disconnections both after recovery and during normal operation under heavy traffic.
Patches 1-2 fix firmware crash recovery:
Patch 1 moves the RECOVERY flag clear to reconfig_complete and adds
CRASH_FLUSH guards to prevent operations on dead firmware.
Patch 2 prevents scans during recovery to avoid NULL dereferences.
Patch 3 fixes MLO beacon miss handling:
Patch 3 skips connection_loss_work for MLO entirely, since its
cancellation mechanism is unreliable and the mac80211 probe triggered by ieee80211_beacon_loss() is sufficient to detect real AP unreachability, as done by other MLO-capable drivers such as mt76 and rtw89.
Tested on WCN7850 with MLO (Wi-Fi 7).
Firmware crashes were observed to occur spontaneously during normal MLO operation with intense traffic testing, though rarely. The debugfs simulate_fw_crash interface was used for systematic testing and reproduction during active MLO connections with traffic.
Note: I will have limited availability from mid-August to mid-September. I will address any review feedback before then or promptly after returning.
v2:
- Rebased on ath/main (requested by Jeff Johnson).
- Patch 1: rebase and address comments from Baochen Qiang:
- Remove CRASH_FLUSH guards from HAL srng source ring helpers (ath12k_hal_srng_src_num_free, ath12k_hal_srng_src_get_next_entry, ath12k_hal_srng_access_end). They were a layering violation — the HAL should not know about device crash semantics. They were added as a precautionary measure to abort as soon as possible, but ath12k_wifi7_dp_tx() already has a CRASH_FLUSH check before any HAL call.
- Fix radio[0] usage in change_vif_links, sta_state, and peer_mlo_link_peers_delete to use per-radio ab.
- Patch 2: fix radio[0] usage
- Drop v1 patch 3 (fix MLO dp_peer ID desync with firmware):
already fixed by Baochen Qiang's ML peer ID series in ath.git
- Drop v1 patch 4 (fix MLO beacon handling using per-link addressing): patch 3 (v1 patch 5) skips connection_loss_work for MLO entirely, making the per-link beacon matching and cancellation in v1 patch 4 unreachable (Baochen Qiang comment).
- No modification for v1 patch 5, now v2 patch 3.
v1: https://lore.kernel.org/all/[email protected]/
Jose Ignacio Tornos Martinez (3):
wifi: ath12k: fix MLO station firmware crash recovery
wifi: ath12k: prevent scan during firmware recovery
wifi: ath12k: skip connection_loss_work for MLO beacon miss
PATCH v2 1/3 wifi: ath12k: fix MLO station firmware crash recovery
ATH12K_FLAG_RECOVERY is cleared too early in ath12k_core_reconfigure_on_crash(), before mac80211 runs ieee80211_reconfig(). By the time mac80211 calls back into the driver (sta_state, change_vif_links, set_key), the RECOVERY flag is already false, so the driver treats recovery callbacks as normal operations.
This causes several problems during MLO recovery:
- ath12k_mac_op_sta_state() tries to activate MLO links during the AUTH->ASSOC transition, calling ieee80211_set_active_links() recursively, which triggers a WARNING at net/mac80211/link.c.
- ath12k_mac_op_change_vif_links() processes link removal during reconfig, causing inconsistent state.
- ath12k_mac_set_key() fails with "cannot install key for non-existent peer" because peers do not exist yet during reconfig. Keys will be re-established during normal reconnection after ieee80211_hw_restart_disconnect() triggers a fresh association.
- ath12k_mac_flush() waits for pending TX to complete, but after a firmware crash the TX will never complete, causing a 20 second timeout.
- ath12k_mac_station_remove() calls ath12k_bss_disassoc() and ath12k_mac_vdev_stop() which send WMI commands to dead firmware, causing timeouts that delay recovery.
- ath12k_clear_peer_keys() tries to look up and clear peer keys, but peers are already gone after firmware crash.
- ath12k_dp_rx_ampdu_stop() dereferences per-link station state that may not be valid during crash teardown.
- ath12k_peer_mlo_link_peers_delete() sends WMI peer delete commands for each MLO link peer. With dead firmware these time out and can trigger cascading resets.
These issues were observed during sporadic firmware crashes in MLO operation. To allow systematic testing and reproduction, the debugfs simulate_fw_crash interface was used to trigger controlled firmware crashes during active MLO connections with traffic.
Fix by moving clear_bit(ATH12K_FLAG_RECOVERY) from ath12k_core_reconfigure_on_crash() to ath12k_mac_op_reconfig_complete(), so the flag stays set through the entire mac80211 reconfig phase. Add ATH12K_FLAG_RECOVERY checks in change_vif_links, set_key, and sta_state to skip operations that are invalid during recovery. Add ATH12K_FLAG_CRASH_FLUSH checks in mac_flush, station_remove, clear_peer_keys, dp_rx_ampdu_stop, and peer_mlo_link_peers_delete to return immediately when the firmware is dead.
Tested on WCN7850 with MLO (Wi-Fi 7).
---
v2: Rebase and address comments from Baochen Qiang:
- Remove CRASH_FLUSH guards from HAL srng source ring helpers (ath12k_hal_srng_src_num_free, ath12k_hal_srng_src_get_next_entry, ath12k_hal_srng_access_end). They were a layering violation — the HAL should not know about device crash semantics. They were added as a precautionary measure to abort as soon as possible, but ath12k_wifi7_dp_tx() already has a CRASH_FLUSH check before any HAL call.
- Fix radio[0] usage in change_vif_links, sta_state, and peer_mlo_link_peers_delete to use per-radio ab.
v1: https://lore.kernel.org/all/[email protected]/
drivers/net/wireless/ath/ath12k/core.c | 2 -- drivers/net/wireless/ath/ath12k/dp_rx.c | 3 +++ drivers/net/wireless/ath/ath12k/mac.c | 27 ++++++++++++++++++++++++- drivers/net/wireless/ath/ath12k/peer.c | 6 ++++++ 4 files changed, 35 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/core.c +0 -2
@@ -1391,8 +1391,6 @@ static int ath12k_core_reconfigure_on_crash(struct ath12k_base *ab)if (ret) goto err_hal_srng_deinit; -clear_bit (ATH12K_FLAG_RECOVERY , &ab->dev_flags); -return 0 ; err_hal_srng_deinit:
drivers/net/wireless/ath/ath12k/dp_rx.c +3 -0
@@ -751,6 +751,9 @@ int ath12k_dp_rx_ampdu_stop(struct ath12k *ar,lockdep_assert_wiphy (ath12k_ar_to_hw (ar)->wiphy); +if (test_bit (ATH12K_FLAG_CRASH_FLUSH , &ab->dev_flags)) +return 0 ; + arsta =wiphy_dereference (ath12k_ar_to_hw (ar)->wiphy, ahsta->link[link_id]);if (!arsta)
drivers/net/wireless/ath/ath12k/mac.c +26 -1
@@ -4341,12 +4341,22 @@ ath12k_mac_op_change_vif_links(struct ieee80211_hw *hw,struct ath12k_vif *ahvif =ath12k_vif_to_ahvif (vif);unsigned long to_remove = old_links & ~new_links;unsigned long to_add = ~old_links & new_links; +unsigned long existing = old_links;struct ath12k_hw *ah =ath12k_hw_to_ah (hw);struct ath12k_link_vif *arvif;u8 link_id;lockdep_assert_wiphy (hw->wiphy); +if (old_links) { +for_each_set_bit (link_id, &existing,IEEE80211_MLD_MAX_NUM_LINKS ) { + arvif =wiphy_dereference (hw->wiphy, ahvif->link[link_id]); +if (arvif && arvif->ar && +test_bit (ATH12K_FLAG_RECOVERY , &arvif->ar->ab->dev_flags)) +return -EINVAL ; + } + } +ath12k_generic_dbg (ATH12K_DBG_MAC ,"mac vif link changed for MLD %pM old_links 0x%x new_links 0x%x\n" , vif->addr, old_links, new_links);
@@ -6025,6 +6035,9 @@ static int ath12k_clear_peer_keys(struct ath12k_link_vif *arvif,lockdep_assert_wiphy (ath12k_ar_to_hw (ar)->wiphy); +if (test_bit (ATH12K_FLAG_CRASH_FLUSH , &ab->dev_flags)) +return 0 ; +spin_lock_bh (&dp->dp_lock); peer =ath12k_dp_link_peer_find_by_vdev_and_addr (dp, arvif->vdev_id, addr);if (!peer || !peer->dp_peer) {
@@ -6100,6 +6113,8 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd,spin_unlock_bh (&dp->dp_lock);if (cmd ==SET_KEY ) { +if (test_bit (ATH12K_FLAG_RECOVERY , &ab->dev_flags)) +return 0 ;ath12k_warn (ab,"cannot install key for non-existent peer %pM\n" , peer_addr);return -EOPNOTSUPP ;
@@ -7100,7 +7115,8 @@ static int ath12k_mac_station_remove(struct ath12k *ar,wiphy_work_cancel (ar->ah->hw->wiphy, &arsta->update_wk); -if (ahvif->vdev_type ==WMI_VDEV_TYPE_STA ) { +if (ahvif->vdev_type ==WMI_VDEV_TYPE_STA && + !test_bit (ATH12K_FLAG_CRASH_FLUSH , &ar->ab->dev_flags)) {ath12k_bss_disassoc (ar, arvif); ret =ath12k_mac_vdev_stop (arvif);if (ret)
@@ -7861,6 +7877,10 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,* MLO case. Other cases would be handled in the future. */ ab = ah->radio[0 ].ab; +if (test_bit (ATH12K_FLAG_RECOVERY , &ab->dev_flags)) { + ret =0 ; + goto exit; + }if (ab->ag->num_devices ==1 ) { ret =ath12k_mac_select_links (ab, vif, hw, &selected_links);if (ret) {
@@ -12661,6 +12681,9 @@ static int ath12k_mac_flush(struct ath12k *ar)long time_left;int ret =0 ; +if (test_bit (ATH12K_FLAG_CRASH_FLUSH , &ar->ab->dev_flags)) +return -ESHUTDOWN ; + time_left =wait_event_timeout (ar->dp.tx_empty_waitq, (atomic_read (&ar->dp.num_tx_pending) ==0 ),ATH12K_FLUSH_TIMEOUT );
@@ -13559,6 +13582,8 @@ ath12k_mac_op_reconfig_complete(struct ieee80211_hw *hw,for_each_ar (ah, ar, i) { ab = ar->ab; +clear_bit (ATH12K_FLAG_RECOVERY , &ab->dev_flags); +ath12k_warn (ar->ab,"pdev %d successfully recovered\n" , ar->pdev->pdev_id);
drivers/net/wireless/ath/ath12k/peer.c +6 -0
@@ -376,12 +376,18 @@ int ath12k_peer_mlo_link_peers_delete(struct ath12k_vif *ahvif, struct ath12k_stunsigned long links;struct ath12k *ar;u8 link_id; +int i;lockdep_assert_wiphy (ah->hw->wiphy);if (!sta->mlo)return -EINVAL ; +for_each_ar (ah, ar, i) { +if (test_bit (ATH12K_FLAG_CRASH_FLUSH , &ar->ab->dev_flags)) +return 0 ; + } + struct ath12k_peer_delete_wait *waits __free(kfree) =kzalloc_objs (*waits,IEEE80211_MLD_MAX_NUM_LINKS );if (!waits)
Signature · 1 line
2.54.0
Re: [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery
On 8/5/2026 1:49 AM, Jose Ignacio Tornos Martinez wrote:
[...]
Quoted 8 lines
Fix by moving
clear_bit(ATH12K_FLAG_RECOVERY)fromath12k_core_reconfigure_on_crash()toath12k_mac_op_reconfig_complete(), so the flag stays set through the entire mac80211 reconfig phase. AddATH12K_FLAG_RECOVERYchecks inchange_vif_links,set_key, andsta_stateto skip operations that are invalid during recovery. AddATH12K_FLAG_CRASH_FLUSHchecks inmac_flush,station_remove,clear_peer_keys,dp_rx_ampdu_stop, andpeer_mlo_link_peers_deleteto return immediately when the firmware is dead.
I don't think patches 1 and 2 are the right approach. Guarding every callback that can run during recovery with a RECOVERY/CRASH_FLUSH check doesn't scale, whatever callback we forget today is the next crash report. Besides, such guards don't help those in-flight ops.
The actual problem is that nothing stops mac80211 from issuing control ops while the ath12k driver is in mid-recovery. I'd rather fix that than keep adding per-op checks.
---
Hi Johannes,
We keep running into this in ath12k and I'd like your opinion before I send anything.
Firmware crash recovery in ath12k (and probably other drivers too) is slow and async: we detect the crash, then do driver internal state cleanup, then power-cycle + firmware reload (total ~1.3s) before the driver is usable again, and only then call ieee80211_restart_hw(). For that whole window mac80211 doesn't know about the crash and keeps pushing scan, connect, add_key, sta_state etc. into the driver that's tearing its state down, which gets us NULL derefs rather than clean failures.
The trouble is I can't see a clean driver-only fix. The driver knows the device is gone at crash-detect, but it has no way to tell mac80211 to hold off until it calls restart_hw(). in_reconfig would do exactly what I want, but it's only raised inside restart_hw(), which is far too late for a device like this - by the time it goes up we've already taken the ops.
So the driver and mac80211 are out of sync for that window and I don't see a good hook to close it today. I see two ways out and I'm not sure which you'd prefer:
1. Do the whole recovery inside the restart path, i.e. move the whole thing including state reset, power cycle and firmware reload into the driver's .start() reached from ieee80211_reconfig(). Then it all runs with the wiphy lock held and in_reconfig already set, so the sync is free and no new API is needed. The downside is we'd be holding rtnl for ~1.3s, which I don't think you'll like.
2. Let the driver raise the barrier early, right after crash is detected, e.g. split ieee80211_restart_hw() into two parts behind separate APIs: the first stops queues and sets in_reconfig, the second just queues the restart work. That way ath12k can do the time-consuming part outside the rtnl lock while staying in sync with mac80211. This would also need a few op entry points that don't currently check in_reconfig (the scan entry, for one) to be filled in, otherwise raising it early doesn't actually fence those ops.
Does either of these look right to you, or is there a direction I'm missing?
Hi Baochen,
I agree that per-callback guards don't scale well long-term. Johannes can comment better because both alternatives need mac80211 changes, but let me share my thoughts.
Option 1 (recovery inside .start()) holds rtnl for ~1.3s, that seems too long to hold.
Option 2 (split ieee80211_restart_hw() into early barrier + deferred restart) looks like the right direction. It would benefit any driver with async recovery, not just ath12k. But it is a mac80211 core change and a bigger effort, and it still needs in_reconfig checks added to callbacks that don't have them today (scan, for one), so the guarding moves to mac80211 rather than disappearing.
In the meantime, the crashes this series fixes are real: without it, an MLO firmware crash gives NULL derefs and 20+ second recovery. The guards here cover the callbacks that actually run during that window, not a speculative list.
I am happy to work on the mac80211 side (option 2), but would it make sense for you to land this series as an interim fix while that is worked out as a follow-up?
Thanks
Best regards
José Ignacio
Quoted 16 lines · Jose Ignacio Tornos Martinez
Hi Baochen,
I agree that per-callback guards don't scale well long-term. Johannes can comment better because both alternatives need mac80211 changes, but let me share my thoughts.
Option 1 (recovery inside .start()) holds rtnl for ~1.3s, that seems too long to hold.
Option 2 (split
ieee80211_restart_hw()into early barrier + deferred restart) looks like the right direction. It would benefit any driver with async recovery, not just ath12k. But it is a mac80211 core change and a bigger effort, and it still needsin_reconfigchecks added to callbacks that don't have them today (scan, for one), so the guarding moves to mac80211 rather than disappearing.
Quoted 6 lines
In the meantime, the crashes this series fixes are real: without it, an MLO firmware crash gives NULL derefs and 20+ second recovery. The guards here cover the callbacks that actually run during that window, not a speculative list.
I am happy to work on the mac80211 side (option 2), but would it make
Johannes doesn't like option 2, let's forget it now. Instead, are you interested in (working on) option 1?
Quoted 2 lines
sense for you to land this series as an interim fix while that is worked out as a follow-up?
Jeff can make the call.
Quoted 6 lines
Thanks
Best regards
José Ignacio
Re: [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery
Hi Baochen,
Quoted 2 lines
Johannes doesn't like option 2, let's forget it now. Instead, are you interested in (working on) option 1?
I can study option 1, but I think Johannes pointed out that taking rtnl only around cfg80211_shutdown_all_interfaces() could not work, so it would mean holding rtnl for the full recovery (~1.3s). It could be a significant rearchitecture of the recovery path to not take a lot of time with no response.
Quoted 4 lines
Quoted 2 lines
sense for you to land this series as an interim fix while that is worked out as a follow-up?
Jeff can make the call.
Jeff and Baochen, in order to get some fix, would you be open to landing this series while option 1 is worked out as a follow-up? Happy to continue with this.
Thanks
Best regards
José Ignacio
Re: [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery
In reply to Baochen QiangQuoted 3 lines · Baochen Qiang
I don't think patches 1 and 2 are the right approach. Guarding every callback that can run during recovery with a RECOVERY/CRASH_FLUSH check doesn't scale, whatever callback we forget today is the next crash report. Besides, such guards don't help those in-flight ops.
So I can relate to that, but ...
Quoted 4 lines
The trouble is I can't see a clean driver-only fix. The driver knows the device is gone at crash-detect, but it has no way to tell mac80211 to hold off until it calls
restart_hw().in_reconfigwould do exactly what I want, but it's only raised insiderestart_hw(), which is far too late for a device like this - by the time it goes up we've already taken the ops.
mac80211 has the same problem? How would *it* hold off rather than annotating every callback from userspace, debugfs, ethtool, sysfs, and the rest of the kernel with checks? *Maybe* at the boundary _to_ the driver, but that's bigger than the boundary every individual driver has...
Quoted 5 lines
1. Do the whole recovery inside the restart path, i.e. move the whole thing including state reset, power cycle and firmware reload into the driver's .start() reached from
ieee80211_reconfig(). Then it all runs with the wiphy lock held andin_reconfigalready set, so the sync is free and no new API is needed. The downside is we'd be holding rtnl for ~1.3s, which I don't think you'll like.
This is what iwlwifi does, but it doesn't take *nearly* as long. :)
There might be a chance to disentangle the RTNL from this given the work I did recently on disentangling it from cfg80211, but then on recovery *failure* we have a problem with cfg80211_shutdown_all_interfaces().
Quoted 8 lines
2. Let the driver raise the barrier early, right after crash is detected, e.g. split
ieee80211_restart_hw()into two parts behind separate APIs: the first stops queues and setsin_reconfig, the second just queues the restart work. That way ath12k can do the time-consuming part outside the rtnl lock while staying in sync with mac80211. This would also need a few op entry points that don't currently checkin_reconfig(the scan entry, for one) to be filled in, otherwise raising it early doesn't actually fence those ops.Does either of these look right to you, or is there a direction I'm missing?
See above - I don't see how we'd really implement the latter reliably in mac80211? Sure, we have a bunch of in_reconfig checks, but ... I wouldn't really trust them and I'm not sure we can guarantee them given the surface area.
johannes
Re: [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery
Quoted 24 lines · Johannes Berg
Quoted 3 lines · Baochen Qiang
I don't think patches 1 and 2 are the right approach. Guarding every callback that can run during recovery with a RECOVERY/CRASH_FLUSH check doesn't scale, whatever callback we forget today is the next crash report. Besides, such guards don't help those in-flight ops.
So I can relate to that, but ...
Quoted 4 lines
The trouble is I can't see a clean driver-only fix. The driver knows the device is gone at crash-detect, but it has no way to tell mac80211 to hold off until it calls
restart_hw().in_reconfigwould do exactly what I want, but it's only raised insiderestart_hw(), which is far too late for a device like this - by the time it goes up we've already taken the ops.mac80211 has the same problem? How would *it* hold off rather than annotating every callback from userspace, debugfs, ethtool, sysfs, and the rest of the kernel with checks? *Maybe* at the boundary _to_ the driver, but that's bigger than the boundary every individual driver has...
Quoted 5 lines
1. Do the whole recovery inside the restart path, i.e. move the whole thing including state reset, power cycle and firmware reload into the driver's .start() reached from
ieee80211_reconfig(). Then it all runs with the wiphy lock held andin_reconfigalready set, so the sync is free and no new API is needed. The downside is we'd be holding rtnl for ~1.3s, which I don't think you'll like.
Quoted 5 lines
This is what iwlwifi does, but it doesn't take *nearly* as long. :)
There might be a chance to disentangle the RTNL from this given the work I did recently on disentangling it from cfg80211, but then on recovery *failure* we have a problem with
cfg80211_shutdown_all_interfaces().
Hmm, I wonder whether the restart work could take rtnl only around cfg80211_shutdown_all_interfaces(). From a quick look, ieee80211_reconfig() itself mostly only needs the wiphy mutex, except ieee80211_add_virtual_monitor(), which asserts RTNL. Though any rtnl holder that then needs this wiphy would still end up stalling everyone while the recovery runs.
Quoted 8 lines
Quoted 8 lines
2. Let the driver raise the barrier early, right after crash is detected, e.g. split
ieee80211_restart_hw()into two parts behind separate APIs: the first stops queues and setsin_reconfig, the second just queues the restart work. That way ath12k can do the time-consuming part outside the rtnl lock while staying in sync with mac80211. This would also need a few op entry points that don't currently checkin_reconfig(the scan entry, for one) to be filled in, otherwise raising it early doesn't actually fence those ops.
Quoted 6 lines
Quoted 1 line
Does either of these look right to you, or is there a direction I'm missing?
See above - I don't see how we'd really implement the latter reliably in mac80211? Sure, we have a bunch of
in_reconfigchecks, but ... I wouldn't really trust them and I'm not sure we can guarantee them given the surface area.
Fair enough, I agree. Looking at it again, option 2 would just move the per-callback checks from the driver into mac80211, with an even bigger surface to cover, so it doesn't really solve anything. Let's drop it.
Quoted 2 lines
johannes
Re: [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery
Quoted 10 lines · Baochen Qiang
Quoted 4 lines
There might be a chance to disentangle the RTNL from this given the work I did recently on disentangling it from cfg80211, but then on recovery *failure* we have a problem with
cfg80211_shutdown_all_interfaces().Hmm, I wonder whether the restart work could take rtnl only around
cfg80211_shutdown_all_interfaces(). From a quick look,ieee80211_reconfig()itself mostly only needs the wiphy mutex, exceptieee80211_add_virtual_monitor(), which asserts RTNL. Though any rtnl holder that then needs this wiphy would still end up stalling everyone while the recovery runs.
No, it's not that simple - it would have to drop the wiphy mutex to acquire RTNL, but then userspace can come inbetween and use the failed device.
johannes
PATCH v2 2/3 wifi: ath12k: prevent scan during firmware recovery
In reply to Jose Ignacio Tornos MartinezWhen firmware crashes while wpa_supplicant has an active connection, wpa_supplicant may immediately attempt a scan via nl80211 while the firmware is still powering on through MHI. ath12k_mac_op_hw_scan() proceeds without checking the recovery state, accessing partially initialized radio structures which leads to a NULL pointer dereference:
BUG: unable to handle page fault for address: 0000000000001508 RIP: ath12k_mac_op_hw_scan+0x148/0x2b0 [ath12k] Call Trace: drv_hw_scan+0x88/0x140 [mac80211] __ieee80211_start_scan+0x2bc/0x6b0 [mac80211] nl80211_trigger_scan+0x54a/0x9f0 [cfg80211]
Fix by checking ATH12K_FLAG_RECOVERY at the start of ath12k_mac_op_hw_scan() and returning -EBUSY. mac80211 will retry the scan after the recovery completes.
Tested on WCN7850 with MLO (Wi-Fi 7).
---
v2: Fix radio[0] usage
v1: https://lore.kernel.org/all/[email protected]/
drivers/net/wireless/ath/ath12k/mac.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath12k/mac.c +5 -0
@@ -5783,6 +5783,11 @@ int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,lockdep_assert_wiphy (hw->wiphy); +for_each_ar (ah, ar, i) { +if (test_bit (ATH12K_FLAG_RECOVERY , &ar->ab->dev_flags)) +return -EBUSY ; + } + chan_list =kzalloc_objs (*chan_list, hw_req->req.n_channels);if (!chan_list)return -ENOMEM ;
Signature · 1 line
2.54.0
PATCH v2 3/3 wifi: ath12k: skip connection_loss_work for MLO beacon miss
In reply to Jose Ignacio Tornos MartinezWhen firmware reports a beacon miss, ath12k queues connection_loss_work as a 3-second backup timer that forces a full VIF disconnect via ieee80211_connection_loss(). This work can only be cancelled when a beacon frame arrives through WMI in ath12k_mac_handle_beacon_iter().
In MLO, this mechanism causes periodic spurious disconnections because the firmware does not reliably forward beacon frames to the host via WMI, making the cancellation path ineffective. The result is a full VIF disconnect every ~16 seconds during normal MLO operation, easily reproducible under heavy traffic.
Skip queueing connection_loss_work for MLO VIFs. The mac80211 AP probe triggered by ieee80211_beacon_loss() is sufficient to detect real AP unreachability. Other MLO-capable drivers such as mt76 and rtw89 similarly rely on ieee80211_beacon_loss() without adding a backup disconnect timer.
Tested on WCN7850 with MLO (Wi-Fi 7).
---
v2: No modification
v1: https://lore.kernel.org/all/[email protected]/
drivers/net/wireless/ath/ath12k/mac.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/mac.c +9 -2
@@ -2008,9 +2008,16 @@ void ath12k_mac_handle_beacon_miss(struct ath12k *ar,* (done by mac80211) succeeds but beacons do not resume then it * doesn't make sense to continue operation. Queue connection loss work * which can be cancelled when beacon is received. +* +* Skip for MLO because connection_loss_work disconnects the entire +* VIF based on a single link's beacon miss, and its cancellation +* mechanism (beacon reception via WMI) is unreliable. The mac80211 +* probe triggered by ieee80211_beacon_loss() above is sufficient +* to detect real AP unreachability. */ -ieee80211_queue_delayed_work (hw, &arvif->connection_loss_work, -ATH12K_CONNECTION_LOSS_HZ ); +if (!ieee80211_vif_is_mld (vif)) +ieee80211_queue_delayed_work (hw, &arvif->connection_loss_work, +ATH12K_CONNECTION_LOSS_HZ ); }static void ath12k_mac_vif_sta_connection_loss_work (struct work_struct *work)
Signature · 1 line
2.54.0
Hi Jeff, Baochen,
Friendly ping on this series. v2 addressed all the comments from v1 (rebased on ath/main, removed HAL CRASH_FLUSH guards, fixed radio[0] usage, dropped patches already covered by Baochen's ML peer ID series).
Any further comments, or anything I can do to move forward?
Thanks
Best regards
José Ignacio
Hi Jeff, Baochen,
Gentle follow-up on this series. Without these fixes, a firmware crash during an active MLO connection results in NULL pointer dereferences and 20+ second recovery delays. Non-MLO recovery works fine; this brings MLO to the same level.
v2 has been on the list since August 4 and addressed all v1 feedback. Happy to rework if something is pending or can be improved.
I know it is better to not have recoveries, but if there are (I have seen some), we would be covered in a fast way.
Thanks
Best regards
José Ignacio