mac80211: fix stopping RX BA session from timer

Kalle reported that his system deadlocks since my
recent work in this area. The reason quickly became
apparent: we try to cancel_timer_sync() a timer
from within itself. Fix that by making the function
aware of the context it is called from.

Reported-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg 2010-04-19 11:00:24 +02:00 коммит произвёл John W. Linville
Родитель 93d95b12b3
Коммит 2aab4c273a
1 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -18,8 +18,9 @@
#include "ieee80211_i.h" #include "ieee80211_i.h"
#include "driver-ops.h" #include "driver-ops.h"
void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, static void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason) u16 initiator, u16 reason,
bool from_timer)
{ {
struct ieee80211_local *local = sta->local; struct ieee80211_local *local = sta->local;
struct tid_ampdu_rx *tid_rx; struct tid_ampdu_rx *tid_rx;
@ -69,10 +70,17 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
del_timer_sync(&tid_rx->session_timer); if (!from_timer)
del_timer_sync(&tid_rx->session_timer);
kfree(tid_rx); kfree(tid_rx);
} }
void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason)
{
___ieee80211_stop_rx_ba_session(sta, tid, initiator, reason, false);
}
/* /*
* After accepting the AddBA Request we activated a timer, * After accepting the AddBA Request we activated a timer,
* resetting it after each frame that arrives from the originator. * resetting it after each frame that arrives from the originator.
@ -91,8 +99,8 @@ static void sta_rx_agg_session_timer_expired(unsigned long data)
#ifdef CONFIG_MAC80211_HT_DEBUG #ifdef CONFIG_MAC80211_HT_DEBUG
printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid); printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid);
#endif #endif
__ieee80211_stop_rx_ba_session(sta, *ptid, WLAN_BACK_RECIPIENT, ___ieee80211_stop_rx_ba_session(sta, *ptid, WLAN_BACK_RECIPIENT,
WLAN_REASON_QSTA_TIMEOUT); WLAN_REASON_QSTA_TIMEOUT, true);
} }
static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *da, u16 tid, static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *da, u16 tid,