summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/mvm/tt.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-08-20 18:26:58 +0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-03 23:33:13 +0400
commitb689fa799a1450056044a47d6afa6ad52f3a8997 (patch)
tree3372f878d2fe2f5d5dd056aefa4111b728f7c984 /drivers/net/wireless/iwlwifi/mvm/tt.c
parenta4db848f2d0160a3fca08a5787dbef6bcc4ce2b3 (diff)
downloadlinux-b689fa799a1450056044a47d6afa6ad52f3a8997.tar.xz
iwlwifi: mvm: reset the temperature when temperature test is disabled
Since we can't read the actual temperature when the firmware is running, just set the temperature to 0 when the test is disabled and disable CT Kill if it was enabled. Additionally, since we rely on iwl_mvm_tt_handler() to exit CT kill when in test mode, call iwl_mvm_exit_ctkill() in that function if the temperature is low again. Also make the iwl_mvm_enter_ctkill() and iwl_mvm_exit_ctkill() return if called when not necessary anymore (e.g. when iwl_mvm_exit_ctkill() is called when we're not in CT-kill). Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/tt.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/tt.c b/drivers/net/wireless/iwlwifi/mvm/tt.c
index 0464599c111e..d31603cbb17d 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tt.c
@@ -314,6 +314,9 @@ static void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm)
{
u32 duration = mvm->thermal_throttle.params->ct_kill_duration;
+ if (test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status))
+ return;
+
IWL_ERR(mvm, "Enter CT Kill\n");
iwl_mvm_set_hw_ctkill_state(mvm, true);
schedule_delayed_work(&mvm->thermal_throttle.ct_kill_exit,
@@ -322,6 +325,9 @@ static void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm)
static void iwl_mvm_exit_ctkill(struct iwl_mvm *mvm)
{
+ if (!test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status))
+ return;
+
IWL_ERR(mvm, "Exit CT Kill\n");
iwl_mvm_set_hw_ctkill_state(mvm, false);
}
@@ -444,6 +450,12 @@ void iwl_mvm_tt_handler(struct iwl_mvm *mvm)
return;
}
+ if (params->support_ct_kill &&
+ temperature <= tt->params->ct_kill_exit) {
+ iwl_mvm_exit_ctkill(mvm);
+ return;
+ }
+
if (params->support_dynamic_smps) {
if (!tt->dynamic_smps &&
temperature >= params->dynamic_smps_entry) {