]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iwlwifi: mvm: reset PM state on unsuccessful resume
authorJohannes Berg <johannes.berg@intel.com>
Sat, 16 Oct 2021 08:43:55 +0000 (11:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:12 +0000 (11:04 +0100)
[ Upstream commit 2f629a7772e2a7bdaff25178917a40073f79702c ]

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: 708a39aaca22 ("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>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index 6a259d867d90ef702c40ffe335e076ac2db95aaa..9ed56c68a506a85debc689c769f7fa88bd6a3b54 100644 (file)
@@ -2093,7 +2093,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;
        }
 
@@ -2142,6 +2141,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;
 
        /*
@@ -2212,6 +2212,9 @@ out:
         */
        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;
 }