mac80211: fix TX aggregation stop race
authorAlexander Wetzel <alexander.wetzel@web.de>
Mon, 14 May 2018 20:33:34 +0000 (22:33 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 May 2018 09:14:36 +0000 (11:14 +0200)
commit39c1134c66b4552f665da576cb625f184a44a8a3
treeb725235aefb3cb2c970d2dc1e443647100b9a819
parent4a22b00b288649f6d697b350ec606574479a2df3
mac80211: fix TX aggregation stop race

The mac80211 tear down code is not waiting for the driver call back.
This can bring down the the TX path (TID) till the user manually
reconnects. (Observed with iwldvm and enabled TX aggregation.)

The race can be prevented when the ampdu_mlme worker handles the tear
down.

The race:
 * ieee80211_sta_tear_down_BA_sessions calls
   ___ieee80211_stop_tx_ba_session for all TIDs,

 * then cancels the ampdu_mlme worker

 * and cleanups the TIDs the driver already has called back for.

 * ieee80211_stop_tx_ba_cb will never be called for a TID if the callback
   came after the the check in ieee80211_sta_tear_down_BA_sessions.

Signed-off-by: Alexander Wetzel <Alexander.Wetzel@web.de>
[johannes: "enabled" -> "blocked" and invert logic, simplify init]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ht.c