]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: recalculate TIM when a station enters power save
authorAndrew Pope <andrew.pope@morsemicro.com>
Fri, 17 Jul 2026 01:17:51 +0000 (11:17 +1000)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 21 Jul 2026 11:35:22 +0000 (13:35 +0200)
When an AP buffers frames for a station on its per-station TXQs and the
station subsequently enters power save, sta_ps_start() records the
buffered TIDs in txq_buffered_tids but does not update the TIM. The
station's TIM bit is only ever set when a further frame is buffered
while the station is already asleep
(ieee80211_tx_h_unicast_ps_buf() -> sta_info_recalc_tim()).

If no further downlink frame arrives for that station the beacon
TIM never advertises the buffered traffic. A station relying on the
TIM then remains in doze indefinitely on top of a non-empty queue. Its
TXQs were removed from the scheduler's active list at PS entry, nothing
pages it, and the flow deadlocks until an unrelated event wakes the
station.

Recalculate the TIM at the end of sta_ps_start(), so traffic
already buffered at PS entry is advertised immediately.
sta_info_recalc_tim() already consults txq_buffered_tids, which is
updated above, and is safe in this context (it is already called
from equivalent paths such as the tx handlers and
ieee80211_handle_filtered_frame()).

Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
Signed-off-by: Andrew Pope <andrew.pope@morsemicro.com>
Link: https://patch.msgid.link/20260717011751.79524-1-andrew.pope@morsemicro.com
[add wifi: subject prefix]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index d9ea19be075dc686c4a34884340b37a716e07ce7..5e26be8e27d8f00a800ef2697d24574979143ca4 100644 (file)
@@ -1717,6 +1717,8 @@ static void sta_ps_start(struct sta_info *sta)
                else
                        clear_bit(tid, &sta->txq_buffered_tids);
        }
+
+       sta_info_recalc_tim(sta);
 }
 
 static void sta_ps_end(struct sta_info *sta)