diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/tt.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/tt.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/tt.c b/drivers/net/wireless/iwlwifi/mvm/tt.c index 0464599c111e..c3e1fe4282f1 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/iwlwifi/mvm/tt.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
7 | * | 7 | * |
8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | ||
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of version 2 of the GNU General Public License as | 12 | * it under the terms of version 2 of the GNU General Public License as |
@@ -31,6 +32,7 @@ | |||
31 | * BSD LICENSE | 32 | * BSD LICENSE |
32 | * | 33 | * |
33 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 34 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
35 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | ||
34 | * All rights reserved. | 36 | * All rights reserved. |
35 | * | 37 | * |
36 | * Redistribution and use in source and binary forms, with or without | 38 | * Redistribution and use in source and binary forms, with or without |
@@ -314,14 +316,26 @@ static void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm) | |||
314 | { | 316 | { |
315 | u32 duration = mvm->thermal_throttle.params->ct_kill_duration; | 317 | u32 duration = mvm->thermal_throttle.params->ct_kill_duration; |
316 | 318 | ||
319 | if (test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status)) | ||
320 | return; | ||
321 | |||
317 | IWL_ERR(mvm, "Enter CT Kill\n"); | 322 | IWL_ERR(mvm, "Enter CT Kill\n"); |
318 | iwl_mvm_set_hw_ctkill_state(mvm, true); | 323 | iwl_mvm_set_hw_ctkill_state(mvm, true); |
319 | schedule_delayed_work(&mvm->thermal_throttle.ct_kill_exit, | 324 | |
320 | round_jiffies_relative(duration * HZ)); | 325 | /* Don't schedule an exit work if we're in test mode, since |
326 | * the temperature will not change unless we manually set it | ||
327 | * again (or disable testing). | ||
328 | */ | ||
329 | if (!mvm->temperature_test) | ||
330 | schedule_delayed_work(&mvm->thermal_throttle.ct_kill_exit, | ||
331 | round_jiffies_relative(duration * HZ)); | ||
321 | } | 332 | } |
322 | 333 | ||
323 | static void iwl_mvm_exit_ctkill(struct iwl_mvm *mvm) | 334 | static void iwl_mvm_exit_ctkill(struct iwl_mvm *mvm) |
324 | { | 335 | { |
336 | if (!test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status)) | ||
337 | return; | ||
338 | |||
325 | IWL_ERR(mvm, "Exit CT Kill\n"); | 339 | IWL_ERR(mvm, "Exit CT Kill\n"); |
326 | iwl_mvm_set_hw_ctkill_state(mvm, false); | 340 | iwl_mvm_set_hw_ctkill_state(mvm, false); |
327 | } | 341 | } |
@@ -444,6 +458,12 @@ void iwl_mvm_tt_handler(struct iwl_mvm *mvm) | |||
444 | return; | 458 | return; |
445 | } | 459 | } |
446 | 460 | ||
461 | if (params->support_ct_kill && | ||
462 | temperature <= tt->params->ct_kill_exit) { | ||
463 | iwl_mvm_exit_ctkill(mvm); | ||
464 | return; | ||
465 | } | ||
466 | |||
447 | if (params->support_dynamic_smps) { | 467 | if (params->support_dynamic_smps) { |
448 | if (!tt->dynamic_smps && | 468 | if (!tt->dynamic_smps && |
449 | temperature >= params->dynamic_smps_entry) { | 469 | temperature >= params->dynamic_smps_entry) { |