Commit 856142cd authored by Johannes Berg's avatar Johannes Berg

mac80211: catch queue stop underflow

If some code stops the queues more times than having started
(for when refcounting is used), warn on and reset the counter
to 0 to avoid blocking forever.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 63b4d8b3
...@@ -288,10 +288,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, ...@@ -288,10 +288,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
if (!test_bit(reason, &local->queue_stop_reasons[queue])) if (!test_bit(reason, &local->queue_stop_reasons[queue]))
return; return;
if (!refcounted) if (!refcounted) {
local->q_stop_reasons[queue][reason] = 0; local->q_stop_reasons[queue][reason] = 0;
else } else {
local->q_stop_reasons[queue][reason]--; local->q_stop_reasons[queue][reason]--;
if (WARN_ON(local->q_stop_reasons[queue][reason] < 0))
local->q_stop_reasons[queue][reason] = 0;
}
if (local->q_stop_reasons[queue][reason] == 0) if (local->q_stop_reasons[queue][reason] == 0)
__clear_bit(reason, &local->queue_stop_reasons[queue]); __clear_bit(reason, &local->queue_stop_reasons[queue]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment