VER-895: wifi: ath12k: fix dp_peer stale entry on station removal failure#79
Conversation
|
@dima1308 @adrian-nicolau guys please review and approve this fix. From my point of view fix is good, but I would like to have one more opinion |
There was a problem hiding this comment.
Pull request overview
Fixes an ath12k station teardown error path where a firmware-side peer delete failure could skip datapath cleanup, leaving a stale dp_peer entry that blocks re-association with -EEXIST.
Changes:
- Add a
peer_cleanuperror path to ensureath12k_dp_peer_delete()is executed onIEEE80211_STA_NONE -> IEEE80211_STA_NOTEXISTfailures. - Add a warning log when forced cleanup is performed.
- Minor whitespace-only change near
ath12k_mac_register().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also search Qualcomm's driver to see if they handle it differently: |
6365f4b to
7369339
Compare
6480b89 to
2d28ff2
Compare
There was a problem hiding this comment.
Pull request overview
Fixes ath12k station teardown so that driver-side dp_peer cleanup still occurs when per-link station removal fails (e.g., firmware timeout during peer delete), preventing stale dp_peer entries that can block subsequent reconnects.
Changes:
- Adjust error handling in
ath12k_mac_op_sta_state()to treatIEEE80211_STA_NONE -> IEEE80211_STA_NOTEXISTteardown failures as non-fatal from mac80211’s perspective. - Ensure the dp_peer deletion path is reached for teardown failures by redirecting to the existing
peer_deletecleanup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes ath12k station teardown so driver-side datapath peer state is cleaned up even when firmware-side peer deletion fails during IEEE80211_STA_NONE -> IEEE80211_STA_NOTEXIST (e.g., hostapd stop with FW timeout), preventing stale dp_peer entries that block reconnects.
Changes:
- Adds a dedicated cleanup jump target for the
STA_NONE -> STA_NOTEXISTfailure path. - Ensures
ath12k_dp_peer_delete()is still executed whenath12k_mac_handle_link_sta_state()fails during station removal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR addresses a reconnect failure in ath12k caused by stale dp_peer entries when station removal proceeds in mac80211 but firmware-side peer deletion fails (e.g., WMI timeout), ensuring driver-side DP cleanup still runs.
Changes:
- Redirect an error
gotopath to a newpeer_cleanuplabel soath12k_dp_peer_delete()can still run after certain failures. - Introduce
peer_cleanup:label before the station removal cleanup block.
Comments suppressed due to low confidence (1)
drivers/net/wireless/ath/ath12k/mac.c:7794
- Because
peer_cleanup:is now a jump target from an error path, the unconditionalret = 0;below this block will overwrite the earlier failure code. That prevents callers/logs from seeing the firmware-side delete failure. Consider only settingret = 0on the non-error fallthrough path (e.g., guard withif (!ret)orgoto exitimmediately after performing the dp peer cleanup whenretis already non-zero).
peer_cleanup:
/* IEEE80211_STA_NONE -> IEEE80211_STA_NOTEXIST:
* Remove the station from driver (handle ML sta here since that
* needs special handling. Normal sta will be handled in generic
* handler below
*/
if (old_state == IEEE80211_STA_NONE &&
new_state == IEEE80211_STA_NOTEXIST) {
if (sta->mlo)
ath12k_mac_ml_station_remove(ahvif, ahsta);
ath12k_dp_peer_delete(&ah->dp_hw, sta->addr, sta);
}
ret = 0;
goto exit;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses an ath12k station removal edge case where a firmware-side peer delete failure can skip datapath peer cleanup, leaving a stale dp_peer entry that later prevents the station from reconnecting.
Changes:
- Adds a
peer_cleanupjump target for theIEEE80211_STA_NONE -> IEEE80211_STA_NOTEXISTtransition when link STA state handling fails. - Ensures
ath12k_dp_peer_delete()is still invoked even if the WMI peer delete fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR addresses an ath12k teardown edge case where a firmware-side peer delete failure can skip host-side cleanup, leaving a stale dp_peer entry that prevents subsequent station reconnects.
Changes:
- Route the
IEEE80211_STA_NONE -> IEEE80211_STA_NOTEXISTfailure path to a newpeer_cleanuplabel soath12k_dp_peer_delete()still runs. - Ensure the teardown path returns success to mac80211 to avoid warnings and state-machine stalls.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens station teardown in ath12k_mac_op_sta_state() by ensuring driver-side datapath peer cleanup still happens when firmware-side peer deletion fails during the IEEE80211_STA_NONE -> IEEE80211_STA_NOTEXIST transition (e.g., WMI timeout), preventing stale dp_peer entries that block reconnect.
Changes:
- Add a dedicated
peer_cleanuppath forNONE -> NOTEXISTteardown failures soath12k_dp_peer_delete()still runs. - Ensure teardown failures in that state transition do not propagate back to mac80211 (avoiding WARN/stuck state machine).
- Expand inline comments to document why errors are suppressed for this transition and what cleanup is still required.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wifi: ath12k: fix dp_peer stale entry on station removal failure
When stopping hostapd, mac80211 triggers a state transition for stations
from IEEE80211_STA_NONE to IEEE80211_STA_NOTEXIST.
In ath12k_mac_op_sta_state, if the WMI command to delete a peer fails
(e.g., due to a firmware timeout), the current error handler jumps
directly to the exit label. This skips the second stage of cleanup:
ath12k_dp_peer_delete().
As a result, an orphaned ath12k_dp_peer entry remains in dp_peers_list.
When the station tries to reconnect, ath12k_dp_peer_create() finds the
stale entry and returns -EEXIST, leading to the error:
"unable to create ath12k_dp_peer for sta".
Fix this by adding a peer_cleanup label that ensures ath12k_dp_peer_delete()
is called even if the firmware-side removal failed, as mac80211 will
remove the station regardless.
Tests: Automation test- 100 times of stop/start hostapd (by changing the RF configuration)