diff mbox

[1/6] iwlwifi: mvm: don't restart HW if suspend fails with unified image

Message ID 20170113123919.30384-2-luca@coelho.fi (mailing list archive)
State Accepted
Delegated to: Luca Coelho
Headers show

Commit Message

Luca Coelho Jan. 13, 2017, 12:39 p.m. UTC
From: Luca Coelho <luciano.coelho@intel.com>

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: commit 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 | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Kalle Valo Jan. 13, 2017, 2:13 p.m. UTC | #1
Luca Coelho <luca@coelho.fi> writes:

> From: Luca Coelho <luciano.coelho@intel.com>
>
> 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: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")

s/commit // :)
Luca Coelho Jan. 13, 2017, 2:21 p.m. UTC | #2
On Fri, 2017-01-13 at 16:13 +0200, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:

> 

> > From: Luca Coelho <luciano.coelho@intel.com>

> > 

> > 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: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")

> 

> s/commit // :)


Argh, did I do it again? I was specifically trying to remember this, but
I guess it was not enough...

--
Luca.
diff mbox

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index b88e2048ae0b..207d8ae1e116 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -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);