aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_sys.c
diff options
context:
space:
mode:
authorFrans Pop <elendil@planet.nl>2009-10-26 03:39:03 -0400
committerLen Brown <len.brown@intel.com>2009-11-05 18:18:36 -0500
commite4143b0324a6a468cb00c4341cd20d60cc441252 (patch)
treea8c0c60fd77d7a2626aa28bd7e6191933d0b542d /drivers/thermal/thermal_sys.c
parent3d8e3ad879441ae14c5957b933028daf39d252b0 (diff)
thermal: Only set passive_delay for forced_passive cooling
Setting polling_delay is useless as passive_delay has priority, so the value shown in proc isn't the actual polling delay. It also gives the impression to the user that he can change the polling interval through proc, while in fact he can't. Also, unset passive_delay when the forced passive trip point is unbound to allow polling to be disabled. Signed-off-by: Frans Pop <elendil@planet.nl> Acked-by: Matthew Garrett <mjg@redhat.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_sys.c')
-rw-r--r--drivers/thermal/thermal_sys.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 310e40ab00b6..663c2fdba775 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -241,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr,
241 cdev); 241 cdev);
242 } 242 }
243 mutex_unlock(&thermal_list_lock); 243 mutex_unlock(&thermal_list_lock);
244 if (!tz->passive_delay)
245 tz->passive_delay = 1000;
244 } else if (!state && tz->forced_passive) { 246 } else if (!state && tz->forced_passive) {
245 mutex_lock(&thermal_list_lock); 247 mutex_lock(&thermal_list_lock);
246 list_for_each_entry(cdev, &thermal_cdev_list, node) { 248 list_for_each_entry(cdev, &thermal_cdev_list, node) {
@@ -251,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr,
251 cdev); 253 cdev);
252 } 254 }
253 mutex_unlock(&thermal_list_lock); 255 mutex_unlock(&thermal_list_lock);
256 tz->passive_delay = 0;
254 } 257 }
255 258
256 tz->tc1 = 1; 259 tz->tc1 = 1;
257 tz->tc2 = 1; 260 tz->tc2 = 1;
258 261
259 if (!tz->passive_delay)
260 tz->passive_delay = 1000;
261
262 if (!tz->polling_delay)
263 tz->polling_delay = 10000;
264
265 tz->forced_passive = state; 262 tz->forced_passive = state;
266 263
267 thermal_zone_device_update(tz); 264 thermal_zone_device_update(tz);