iwlwifi: mvm: handle device start failures during restart
authorJohannes Berg <johannes.berg@intel.com>
Wed, 30 Apr 2014 14:34:45 +0000 (16:34 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 24 Jun 2014 18:55:41 +0000 (21:55 +0300)
If the device fails during a restart, mac80211 now handles the
situation better but we still have a little bit of cleanup to
do in the driver - add the required code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: ArikX Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/mac80211.c

index f2fde36491398d6b5a6e045a8400d7b75527dfd3..3c2c9b99b59e3ac2060317ce3008410fe6cfd544 100644 (file)
@@ -689,6 +689,16 @@ static int iwl_mvm_mac_start(struct ieee80211_hw *hw)
                iwl_mvm_restart_cleanup(mvm);
 
        ret = iwl_mvm_up(mvm);
+
+       if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
+               /* Something went wrong - we need to finish some cleanup
+                * that normally iwl_mvm_mac_restart_complete() below
+                * would do.
+                */
+               clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
+               iwl_mvm_d0i3_enable_tx(mvm, NULL);
+       }
+
        mutex_unlock(&mvm->mutex);
 
        return ret;