summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/mvm/debugfs.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-08-20 17:26:58 +0300
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-03 22:33:13 +0300
commitb689fa799a1450056044a47d6afa6ad52f3a8997 (patch)
tree3372f878d2fe2f5d5dd056aefa4111b728f7c984 /drivers/net/wireless/iwlwifi/mvm/debugfs.c
parenta4db848f2d0160a3fca08a5787dbef6bcc4ce2b3 (diff)
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/debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/debugfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index f7e44889182a..83e562b95a8e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -296,7 +296,15 @@ static ssize_t iwl_dbgfs_set_nic_temperature_write(struct iwl_mvm *mvm,
mutex_lock(&mvm->mutex);
if (temperature == IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE) {
+ if (!mvm->temperature_test)
+ goto out;
+
mvm->temperature_test = false;
+ /* Since we can't read the temp while awake, just set
+ * it to zero until we get the next RX stats from the
+ * firmware.
+ */
+ mvm->temperature = 0;
} else {
mvm->temperature_test = true;
mvm->temperature = temperature;
@@ -306,6 +314,8 @@ static ssize_t iwl_dbgfs_set_nic_temperature_write(struct iwl_mvm *mvm,
mvm->temperature);
/* handle the temperature change */
iwl_mvm_tt_handler(mvm);
+
+out:
mutex_unlock(&mvm->mutex);
return count;