Commit 2d42801b authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach

Revert "iwlwifi: mvm: move deferred d0i3 exit to resume_complete op"

This reverts commit 088070a2.

When working in d0i3_on_idle mode, we explicitly go out
of d0i3 on resume (so other potential commands could
be sent).

However, D0I3_DEFER_WAKEUP is currently cleared on
resume complete (which happens only later on), causing
d0i3 exit to timeout.

Since mac80211 was modified to accept incoming frames
once drv_resume was called, we can safely revert this
patch, and handle the pending work on iwl_mvm_resume().
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 88742c9e
...@@ -1935,28 +1935,56 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) ...@@ -1935,28 +1935,56 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
return 1; return 1;
} }
int iwl_mvm_resume(struct ieee80211_hw *hw) static int iwl_mvm_resume_d3(struct iwl_mvm *mvm)
{ {
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); iwl_trans_resume(mvm->trans);
return __iwl_mvm_resume(mvm, false);
}
static int iwl_mvm_resume_d0i3(struct iwl_mvm *mvm)
{
bool exit_now;
/*
* make sure to clear D0I3_DEFER_WAKEUP before
* calling iwl_trans_resume(), which might wait
* for d0i3 exit completion.
*/
mutex_lock(&mvm->d0i3_suspend_mutex);
__clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
exit_now = __test_and_clear_bit(D0I3_PENDING_WAKEUP,
&mvm->d0i3_suspend_flags);
mutex_unlock(&mvm->d0i3_suspend_mutex);
if (exit_now) {
IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n");
_iwl_mvm_exit_d0i3(mvm);
}
iwl_trans_resume(mvm->trans); iwl_trans_resume(mvm->trans);
if (mvm->hw->wiphy->wowlan_config->any) { if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) {
/* 'any' trigger means d0i3 usage */ int ret = iwl_mvm_exit_d0i3(mvm->hw->priv);
if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) {
int ret = iwl_mvm_exit_d0i3(hw->priv);
if (ret) if (ret)
return ret; return ret;
/* /*
* d0i3 exit will be deferred until reconfig_complete. * d0i3 exit will be deferred until reconfig_complete.
* make sure there we are out of d0i3. * make sure there we are out of d0i3.
*/ */
}
return 0;
} }
return 0;
}
return __iwl_mvm_resume(mvm, false); int iwl_mvm_resume(struct ieee80211_hw *hw)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
/* 'any' trigger means d0i3 was used */
if (hw->wiphy->wowlan_config->any)
return iwl_mvm_resume_d0i3(mvm);
else
return iwl_mvm_resume_d3(mvm);
} }
void iwl_mvm_set_wakeup(struct ieee80211_hw *hw, bool enabled) void iwl_mvm_set_wakeup(struct ieee80211_hw *hw, bool enabled)
......
...@@ -1433,22 +1433,9 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) ...@@ -1433,22 +1433,9 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)
static void iwl_mvm_resume_complete(struct iwl_mvm *mvm) static void iwl_mvm_resume_complete(struct iwl_mvm *mvm)
{ {
bool exit_now;
if (!iwl_mvm_is_d0i3_supported(mvm)) if (!iwl_mvm_is_d0i3_supported(mvm))
return; return;
mutex_lock(&mvm->d0i3_suspend_mutex);
__clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
exit_now = __test_and_clear_bit(D0I3_PENDING_WAKEUP,
&mvm->d0i3_suspend_flags);
mutex_unlock(&mvm->d0i3_suspend_mutex);
if (exit_now) {
IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n");
_iwl_mvm_exit_d0i3(mvm);
}
if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND)
if (!wait_event_timeout(mvm->d0i3_exit_waitq, if (!wait_event_timeout(mvm->d0i3_exit_waitq,
!test_bit(IWL_MVM_STATUS_IN_D0I3, !test_bit(IWL_MVM_STATUS_IN_D0I3,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment