diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/d3.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index df018972a46b..a7dc85c704a9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -975,7 +975,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, }; struct iwl_host_cmd d3_cfg_cmd = { .id = D3_CONFIG_CMD, - .flags = CMD_WANT_SKB, + .flags = CMD_WANT_SKB | CMD_SEND_IN_D3, .data[0] = &d3_cfg_cmd_data, .len[0] = sizeof(d3_cfg_cmd_data), }; @@ -997,6 +997,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, set_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); + synchronize_net(); + vif = iwl_mvm_get_bss_vif(mvm); if (IS_ERR_OR_NULL(vif)) { ret = 1; @@ -1065,6 +1067,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, if (mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000) iwl_fw_dbg_stop_restart_recording(&mvm->fwrt, NULL, true); + mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; + /* must be last -- this switches firmware state */ ret = iwl_mvm_send_cmd(mvm, &d3_cfg_cmd); if (ret) @@ -1103,19 +1107,11 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); - struct iwl_trans *trans = mvm->trans; - int ret; iwl_mvm_pause_tcm(mvm, true); iwl_fw_runtime_suspend(&mvm->fwrt); - ret = iwl_trans_suspend(trans); - if (ret) - return ret; - - trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; - return __iwl_mvm_suspend(hw, wowlan, false); } @@ -2047,12 +2043,10 @@ 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; } - iwl_dbg_tlv_time_point(&mvm->fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_END, - NULL); - ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test, !unified_image); if (ret) goto err; @@ -2065,7 +2059,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) if (d0i3_first) { struct iwl_host_cmd cmd = { .id = D0I3_END_CMD, - .flags = CMD_WANT_SKB, + .flags = CMD_WANT_SKB | CMD_SEND_IN_D3, }; int len; @@ -2098,6 +2092,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) } } + mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; + /* * Query the current location and source from the D3 firmware so we * can play it back when we re-intiailize the D0 firmware @@ -2141,7 +2137,7 @@ err: out_iterate: if (!test) - ieee80211_iterate_active_interfaces_rtnl(mvm->hw, + ieee80211_iterate_active_interfaces_mtx(mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_d3_disconnect_iter, keep ? vif : NULL); @@ -2169,21 +2165,12 @@ out: return 1; } -static int iwl_mvm_resume_d3(struct iwl_mvm *mvm) -{ - iwl_trans_resume(mvm->trans); - - return __iwl_mvm_resume(mvm, false); -} - int iwl_mvm_resume(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; - ret = iwl_mvm_resume_d3(mvm); - - mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; + ret = __iwl_mvm_resume(mvm, false); iwl_mvm_resume_tcm(mvm); @@ -2210,10 +2197,6 @@ static int iwl_mvm_d3_test_open(struct inode *inode, struct file *file) file->private_data = inode->i_private; - synchronize_net(); - - mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; - iwl_mvm_pause_tcm(mvm, true); iwl_fw_runtime_suspend(&mvm->fwrt); @@ -2283,8 +2266,6 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) iwl_fw_runtime_resume(&mvm->fwrt); - mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; - iwl_abort_notification_waits(&mvm->notif_wait); if (!unified_image) { int remaining_time = 10; |