From: Felix Fietkau Date: Tue, 19 Mar 2019 11:00:13 +0000 (+0100) Subject: mac80211: un-schedule TXQs on powersave start X-Git-Tag: v5.15~6591^2~35^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b49c15e1211cc962cb73bbaaa5175ae068144893;p=platform%2Fkernel%2Flinux-starfive.git mac80211: un-schedule TXQs on powersave start Once a station enters powersave, its queues should not be returned by ieee80211_next_txq() anymore. They will be re-scheduled again after the station has woken up again Fixes: 1866760096bf4 ("mac80211: Add TXQ scheduling API") Signed-off-by: Felix Fietkau Acked-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 7f8d934..bf0b187 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1568,7 +1568,15 @@ static void sta_ps_start(struct sta_info *sta) return; for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) { - if (txq_has_queue(sta->sta.txq[tid])) + struct ieee80211_txq *txq = sta->sta.txq[tid]; + struct txq_info *txqi = to_txq_info(txq); + + spin_lock(&local->active_txq_lock[txq->ac]); + if (!list_empty(&txqi->schedule_order)) + list_del_init(&txqi->schedule_order); + spin_unlock(&local->active_txq_lock[txq->ac]); + + if (txq_has_queue(txq)) set_bit(tid, &sta->txq_buffered_tids); else clear_bit(tid, &sta->txq_buffered_tids);