aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/thermal.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>2015-03-15 20:36:24 +0530
committerKalle Valo <kvalo@qca.qualcomm.com>2015-03-23 17:16:50 +0200
commit28bf0c4e3fdd3bfde8b2252f38d1d7ddb70449d6 (patch)
tree8a027f57c43591cbc11dbe1a77ff5eb3f5336be1 /drivers/net/wireless/ath/ath10k/thermal.c
parentath10k: do not restrict thermal throttling to ap mode (diff)
downloadlinux-dev-28bf0c4e3fdd3bfde8b2252f38d1d7ddb70449d6.tar.xz
linux-dev-28bf0c4e3fdd3bfde8b2252f38d1d7ddb70449d6.zip
ath10k: cache throttle state when device is down
Allow driver to cache the throttle state when the devie is not yet started. Configure the cached throttle state while powering up the device. Since thermal daemon is unaware of the up/down cycle, it assumes that device is throttled. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/thermal.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/thermal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index 604ea002ff6f..0b4cd3f16ef8 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -52,19 +52,19 @@ ath10k_thermal_set_cur_throttle_state(struct thermal_cooling_device *cdev,
struct ath10k *ar = cdev->devdata;
int ret = 0;
+ if (throttle_state > ATH10K_THERMAL_THROTTLE_MAX) {
+ ath10k_warn(ar, "throttle state %ld is exceeding the limit %d\n",
+ throttle_state, ATH10K_THERMAL_THROTTLE_MAX);
+ return -EINVAL;
+ }
mutex_lock(&ar->conf_mutex);
+ ar->thermal.throttle_state = throttle_state;
+
if (ar->state != ATH10K_STATE_ON) {
ret = -ENETDOWN;
goto out;
}
- if (throttle_state > ATH10K_THERMAL_THROTTLE_MAX) {
- ath10k_warn(ar, "throttle state %ld is exceeding the limit %d\n",
- throttle_state, ATH10K_THERMAL_THROTTLE_MAX);
- ret = -EINVAL;
- goto out;
- }
- ar->thermal.throttle_state = throttle_state;
ath10k_thermal_set_throttling(ar);
out:
mutex_unlock(&ar->conf_mutex);