diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 404c5e82e4ca..023bc81bd4a0 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -242,13 +242,11 @@ EXPORT_SYMBOL(ieee80211_ctstoself_duration); static void __ieee80211_kick_airtime(struct ieee80211_local *local, int ac) { - bool seen_eligible = false; struct txq_info *txqi; struct sta_info *sta; spin_lock_bh(&local->active_txq_lock[ac]); - begin: if (list_empty(&local->active_txqs[ac])) goto out; @@ -258,12 +256,12 @@ static void __ieee80211_kick_airtime(struct ieee80211_local *local, int ac) sta = container_of(txqi->txq.sta, struct sta_info, sta); - if (sta->airtime[ac].deficit >= 0) { - seen_eligible = true; - - if (!test_and_clear_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, - &txqi->flags)) + if (test_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, &txqi->flags)) { + clear_bit(IEEE80211_TXQ_AIRTIME_THROTTLE, &txqi->flags); + if (sta->airtime[ac].deficit < 0) { + sta->airtime[ac].deficit += sta->airtime_weight; continue; + } spin_unlock_bh(&local->active_txq_lock[ac]); drv_wake_tx_queue(local, txqi); @@ -271,21 +269,6 @@ static void __ieee80211_kick_airtime(struct ieee80211_local *local, int ac) } } - /* No active queues have positive deficit, which means TX is stuck; - * increase all deficits to get things unstuck. - */ - if (!seen_eligible) { - list_for_each_entry(txqi, &local->active_txqs[ac], schedule_order) { - if (!txqi->txq.sta) - continue; - - sta = container_of(txqi->txq.sta, struct sta_info, sta); - - sta->airtime[ac].deficit += sta->airtime_weight; - } - - goto begin; - } out: spin_unlock_bh(&local->active_txq_lock[ac]);