Skip to content

Commit

Permalink
iwlwifi: mvm: reset PM state on unsuccessful resume
Browse files Browse the repository at this point in the history
[ Upstream commit 2f629a7 ]

If resume fails for some reason, we need to set the PM state
back to normal so we're able to send commands during firmware
reset, rather than failing all of them because we're in D3.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 708a39a ("iwlwifi: mvm: don't send commands during suspend\resume transition")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20211016114029.7ceb9eaca9f6.If0cbef38c6d07ec1ddce125878a4bdadcb35d2c9@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jmberg-intel authored and gregkh committed Nov 18, 2021
1 parent 89f000f commit f2fd84b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/intel/iwlwifi/mvm/d3.c
Expand Up @@ -2336,7 +2336,6 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
false, 0);
ret = 1;
mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
goto err;
}

Expand Down Expand Up @@ -2385,6 +2384,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
}
}

/* after the successful handshake, we're out of D3 */
mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;

/*
Expand Down Expand Up @@ -2455,6 +2455,9 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
*/
set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);

/* regardless of what happened, we're now out of D3 */
mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;

return 1;
}

Expand Down

0 comments on commit f2fd84b

Please sign in to comment.