iwlwifi: mvm: don't restart HW if suspend fails with unified image
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 7 Oct 2016 12:16:26 +0000 (15:16 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 23 Jan 2017 21:36:46 +0000 (23:36 +0200)
For unified images, we shouldn't restart the HW if suspend fails.  The
only reason for restarting the HW with non-unified images is to go
back to the D0 image.

Fixes: 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index b88e2048ae0baa207406972c618a28c7db4026e4..207d8ae1e1160d6239a537981d30e659161fc40d 100644 (file)
@@ -1262,12 +1262,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
        iwl_trans_d3_suspend(mvm->trans, test, !unified_image);
  out:
        if (ret < 0) {
-               iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
-               if (mvm->restart_fw > 0) {
-                       mvm->restart_fw--;
-                       ieee80211_restart_hw(mvm->hw);
-               }
                iwl_mvm_free_nd(mvm);
+
+               if (!unified_image) {
+                       iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
+                       if (mvm->restart_fw > 0) {
+                               mvm->restart_fw--;
+                               ieee80211_restart_hw(mvm->hw);
+                       }
+               }
        }
  out_noreset:
        mutex_unlock(&mvm->mutex);