1 From: Alexander Wetzel <alexander@wetzel-home.de>
2 Date: Thu, 15 Sep 2022 15:09:46 +0200
3 Subject: [PATCH] mac80211: Ensure vif queues are operational after start
5 Make sure local->queue_stop_reasons and vif.txqs_stopped stay in sync.
7 When a new vif is created the queues may end up in an inconsistent state
9 Communication not using iTXQ will work, allowing to e.g. complete the
10 association. But the 4-way handshake will time out. The sta will not
11 send out any skbs queued in iTXQs.
13 All normal attempts to start the queues will fail when reaching this
15 local->queue_stop_reasons will have marked all queues as operational but
16 vif.txqs_stopped will still be set, creating an inconsistent internal
19 In reality this seems to be race between the mac80211 function
20 ieee80211_do_open() setting SDATA_STATE_RUNNING and the wake_txqs_tasklet:
21 Depending on the driver and the timing the queues may end up to be
24 Cc: stable@vger.kernel.org
25 Fixes: f856373e2f31 ("wifi: mac80211: do not wake queues on a vif that is being stopped")
26 Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
29 --- a/net/mac80211/util.c
30 +++ b/net/mac80211/util.c
31 @@ -301,14 +301,14 @@ static void __ieee80211_wake_txqs(struct
35 + sdata->vif.txqs_stopped[ac] = false;
37 if (!test_bit(SDATA_STATE_RUNNING, &sdata->state))
40 if (sdata->vif.type == NL80211_IFTYPE_AP)
43 - sdata->vif.txqs_stopped[ac] = false;
45 list_for_each_entry_rcu(sta, &local->sta_list, list) {
46 if (sdata != sta->sdata)