Skip to content

ath11k_nss: fix self-deadlock in peer sta kickout event - #111

Open
kk1987 wants to merge 1 commit into
qosmio:25.12-nssfrom
kk1987:fix-ath11k-kickout-deadlock
Open

ath11k_nss: fix self-deadlock in peer sta kickout event#111
kk1987 wants to merge 1 commit into
qosmio:25.12-nssfrom
kk1987:fix-ath11k-kickout-deadlock

Conversation

@kk1987

@kk1987 kk1987 commented Aug 17, 2026

Copy link
Copy Markdown

ath11k_peer_sta_kickout_event(), as rewritten by 999-900-bss-transition-handling.patch, calls ath11k_dp_peer_cleanup() while still holding ab->base_lock — but ath11k_dp_peer_cleanup() starts by taking ab->base_lock itself (dp.c). Spinlocks are not recursive, so hitting the Spurious quick kickout for STA %pM but found in peer table branch spins that CPU forever with BHs disabled, the other CPUs soon pile up on the same lock, and the box hangs silently until the SoC watchdog resets it — no panic, nothing in pstore.

I hit this twice within one day on a Linksys MX4300 (IPQ8074, 25.12-nss @ d6848fa): both times that warning was the very last kernel message, logged ~1 s after hostapd had deauthenticated the same STA — the race window where mac80211 has already dropped the station but the driver peer table still holds the peer, which is exactly the condition this branch handles. The gap between the last log line and the next kernel boot matched the 30 s SoC watchdog timeout both times.

The fix snapshots vdev_id under the lock, drops the lock, then calls ath11k_dp_peer_cleanup() — the snapshot matters because save_peer may be freed the moment the lock is released. It also initialises save_peer to NULL: it is only assigned inside the per-radio loop, so whenever no radio holds the peer the branch was previously tested on an uninitialised pointer.

Verified that the full mac80211 patch stack still applies cleanly to backports-6.18.26 with this change, and the equivalent fix compile-tests fine in my MX4300 build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uuv2b5Njo1YG8TkLXAD5LP

The rewritten ath11k_peer_sta_kickout_event() in
999-900-bss-transition-handling.patch calls ath11k_dp_peer_cleanup()
while holding ab->base_lock. ath11k_dp_peer_cleanup() takes
ab->base_lock itself, so hitting the "Spurious quick kickout for STA
... but found in peer table" branch self-deadlocks the CPU with BHs
disabled; the box hangs silently until the SoC watchdog resets it
(no panic, empty pstore).

Observed twice within one day on a Linksys MX4300 (IPQ8074): both
times the warning was the last kernel message before a silent hang
and a watchdog reset ~30 s later. The trigger window is a firmware
PEER_STA_KICKOUT arriving ~1 s after hostapd deauthenticated the
same STA, so mac80211 has dropped the station while the driver peer
table still holds it.

Snapshot vdev_id and drop the lock before calling
ath11k_dp_peer_cleanup(), since the peer may go away once the lock is
released. Also initialise save_peer, so the branch is not entered on
an uninitialised pointer when no radio has the peer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uuv2b5Njo1YG8TkLXAD5LP
@kk1987
kk1987 force-pushed the fix-ath11k-kickout-deadlock branch from 6ae957d to e955515 Compare August 21, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant