Revert "wifi: mac80211: fix BA session teardown race"

This reverts commit a2036d5d3c.
This commit is contained in:
Ksawlii 2024-11-24 00:23:53 +01:00
parent 038863cd84
commit c186dd147a
3 changed files with 8 additions and 15 deletions

View file

@ -491,7 +491,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
{
struct tid_ampdu_tx *tid_tx;
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
struct ieee80211_sub_if_data *sdata;
struct ieee80211_ampdu_params params = {
.sta = &sta->sta,
.action = IEEE80211_AMPDU_TX_START,
@ -521,6 +521,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
*/
synchronize_net();
sdata = sta->sdata;
params.ssn = sta->tid_seq[tid] >> 4;
ret = drv_ampdu_action(local, sdata, &params);
tid_tx->ssn = params.ssn;
@ -534,6 +535,9 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
*/
set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state);
} else if (ret) {
if (!sdata)
return;
ht_dbg(sdata,
"BA request denied - HW unavailable for %pM tid %d\n",
sta->sta.addr, tid);

View file

@ -331,6 +331,9 @@ int drv_ampdu_action(struct ieee80211_local *local,
might_sleep();
if (!sdata)
return -EIO;
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
return -EIO;

View file

@ -1064,20 +1064,6 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
* after _part1 and before _part2!
*/
/*
* There's a potential race in _part1 where we set WLAN_STA_BLOCK_BA
* but someone might have just gotten past a check, and not yet into
* queuing the work/creating the data/etc.
*
* Do another round of destruction so that the worker is certainly
* canceled before we later free the station.
*
* Since this is after synchronize_rcu()/synchronize_net() we're now
* certain that nobody can actually hold a reference to the STA and
* be calling e.g. ieee80211_start_tx_ba_session().
*/
ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA);
might_sleep();
lockdep_assert_held(&local->sta_mtx);