Commit e4143b03 authored by Frans Pop's avatar Frans Pop Committed by Len Brown

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: default avatarFrans Pop <elendil@planet.nl>
Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3d8e3ad8
...@@ -241,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr, ...@@ -241,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr,
cdev); cdev);
} }
mutex_unlock(&thermal_list_lock); mutex_unlock(&thermal_list_lock);
if (!tz->passive_delay)
tz->passive_delay = 1000;
} else if (!state && tz->forced_passive) { } else if (!state && tz->forced_passive) {
mutex_lock(&thermal_list_lock); mutex_lock(&thermal_list_lock);
list_for_each_entry(cdev, &thermal_cdev_list, node) { list_for_each_entry(cdev, &thermal_cdev_list, node) {
...@@ -251,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr, ...@@ -251,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr,
cdev); cdev);
} }
mutex_unlock(&thermal_list_lock); mutex_unlock(&thermal_list_lock);
tz->passive_delay = 0;
} }
tz->tc1 = 1; tz->tc1 = 1;
tz->tc2 = 1; tz->tc2 = 1;
if (!tz->passive_delay)
tz->passive_delay = 1000;
if (!tz->polling_delay)
tz->polling_delay = 10000;
tz->forced_passive = state; tz->forced_passive = state;
thermal_zone_device_update(tz); thermal_zone_device_update(tz);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment