wl1251: fix deadlock with ieee80211 beacon filter calls
authorYuri Ershov <ext-yuri.ershov@nokia.com>
Wed, 27 Oct 2010 10:47:25 +0000 (14:47 +0400)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 5 Mar 2011 21:18:01 +0000 (23:18 +0200)
Lockdep shows that there is a deadlock when calling ieee80211_rssi_changed()
under wl->mutex. Fix it by releasing mutex before calling mac80211 functions.
This patch is based on Work-In-Progress patch sent by Kalle Valo.

Signed-off-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
drivers/net/wireless/wl12xx/wl1251_event.c

index 3c8daa2..0423c79 100644 (file)
@@ -81,9 +81,12 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
 
        if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && wl->psm) {
                wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
+               /* need to unlock mutex to avoid deadlocking with rtnl */
+               mutex_unlock(&wl->mutex);
 
                /* indicate to the stack, that beacons have been lost */
                ieee80211_beacon_loss(wl->vif);
+               mutex_lock(&wl->mutex);
        }
 
        if (vector & REGAINED_BSS_EVENT_ID) {