wlcore: always clear recovery flag during recovery_work
authorArik Nemtsov <arik@wizery.com>
Mon, 25 Jun 2012 19:26:20 +0000 (22:26 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Jul 2012 16:10:13 +0000 (12:10 -0400)
If recovery is called when the FW is off, we should clear the recovery
flag. Otherwise we risk booting the driver in permanent pending-recovery
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/main.c

index c5b8c5cadae6b523ba6d461600ad7a5903dd2ce9..1590a1ce4abda414867585e5c138e27b922d9ead 100644 (file)
@@ -926,7 +926,6 @@ static void wl1271_recovery_work(struct work_struct *work)
 
        if (no_recovery) {
                wl1271_info("No recovery (chosen on module load). Fw will remain stuck.");
-               clear_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags);
                goto out_unlock;
        }
 
@@ -970,7 +969,8 @@ static void wl1271_recovery_work(struct work_struct *work)
        wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_FW_RESTART);
        return;
 out_unlock:
-        wl->watchdog_recovery = false;
+       wl->watchdog_recovery = false;
+       clear_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags);
        mutex_unlock(&wl->mutex);
 }