Skip to content

Commit 98e93e9

Browse files
ilanpeer2jmberg-intel
authored andcommitted
mac80211: Complete ampdu work schedule during session tear down
Commit 7a7c0a6 ("mac80211: fix TX aggregation start/stop callback race") added a cancellation of the ampdu work after the loop that stopped the Tx and Rx BA sessions. However, in some cases, e.g., during HW reconfig, the low level driver might call mac80211 APIs to complete the stopping of the BA sessions, which would queue the ampdu work to handle the actual completion. This work needs to be performed as otherwise mac80211 data structures would not be properly synced. Fix this by checking if BA session STOP_CB bit is set after the BA session cancellation and properly clean the session. Signed-off-by: Ilan Peer <ilan.peer@intel.com> [Johannes: the work isn't flushed because that could do other things we don't want, and the locking situation isn't clear] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 4e0854a commit 98e93e9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

net/mac80211/ht.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,24 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
300300

301301
/* stopping might queue the work again - so cancel only afterwards */
302302
cancel_work_sync(&sta->ampdu_mlme.work);
303+
304+
/*
305+
* In case the tear down is part of a reconfigure due to HW restart
306+
* request, it is possible that the low level driver requested to stop
307+
* the BA session, so handle it to properly clean tid_tx data.
308+
*/
309+
mutex_lock(&sta->ampdu_mlme.mtx);
310+
for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
311+
struct tid_ampdu_tx *tid_tx =
312+
rcu_dereference_protected_tid_tx(sta, i);
313+
314+
if (!tid_tx)
315+
continue;
316+
317+
if (test_and_clear_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state))
318+
ieee80211_stop_tx_ba_cb(sta, i, tid_tx);
319+
}
320+
mutex_unlock(&sta->ampdu_mlme.mtx);
303321
}
304322

305323
void ieee80211_ba_session_work(struct work_struct *work)

0 commit comments

Comments
 (0)