[PATCH 06/10] wifi: mt76: mt7603: tell mac80211 when the PS queue has run empty
Felix Fietkau <[email protected]> Sat, 1 Aug 2026 14:53:30 +0000
| Newsgroups | org.kernel.vger.linux-wireless |
|---|---|
| Message-ID | <[email protected]> |
mt7603_rx_loopback_skb() marks a TID as buffered when the hardware redirects a frame into the driver PS queue, but nothing ever clears that state again. mac80211 therefore keeps the TIM bit set for the station and keeps routing every service period to the driver, which also prevents it from releasing frames it has buffered itself. Clear the buffered state for every requested TID that has no frames left in the PS queue. Signed-off-by: Felix Fietkau <[email protected]> --- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index 7c231995392b..c968ee3d591a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -464,8 +464,10 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw, struct sk_buff_head list; struct sk_buff *skb, *tmp, *last; bool eosp_null, uapsd; + unsigned long drained; u16 pending = 0; u8 last_tid; + int i; __skb_queue_head_init(&list); @@ -489,6 +491,15 @@ mt7603_release_buffered_frames(struct ieee80211_hw *hw, pending |= BIT(skb->priority); spin_unlock_bh(&dev->ps_lock); + /* + * Without this, mac80211 keeps the TIM bit set for the station and + * keeps routing every service period to the driver, even though there + * is nothing left to release. + */ + drained = tids & ~pending; + for_each_set_bit(i, &drained, IEEE80211_NUM_TIDS) + ieee80211_sta_set_buffered(sta, i, false); + last = skb_peek_tail(&list); if (!last) { mt76_release_buffered_frames(hw, sta, tids, nframes, reason, -- 2.53.0