ath9k_htc: Move work cancellation outside of mutex
authorSujith Manoharan <Sujith.Manoharan@atheros.com>
Tue, 28 Dec 2010 08:58:14 +0000 (14:28 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Jan 2011 19:43:00 +0000 (14:43 -0500)
There is no need to lock the various work cancellation
calls. This will be helpful when handling FATAL events.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc_drv_main.c

index dd17909bd90381830d3d236e476c5176c19c2317..5f75f70db5a73d84f028fbda69607451bc49a5f7 100644 (file)
@@ -1218,6 +1218,11 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
        int ret = 0;
        u8 cmd_rsp;
 
+       /* Cancel all the running timers/work .. */
+       cancel_work_sync(&priv->ps_work);
+       cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
+       ath9k_led_stop_brightness(priv);
+
        mutex_lock(&priv->mutex);
 
        if (priv->op_flags & OP_INVALID) {
@@ -1226,11 +1231,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
                return;
        }
 
-       /* Cancel all the running timers/work .. */
-       cancel_work_sync(&priv->ps_work);
-       cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
-       ath9k_led_stop_brightness(priv);
-
        ath9k_htc_ps_wakeup(priv);
        htc_stop(priv->htc);
        WMI_CMD(WMI_DISABLE_INTR_CMDID);