Skip to content

Commit

Permalink
thermal: Only set passive_delay for forced_passive cooling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frans Pop authored and Len Brown committed Nov 5, 2009
1 parent 3d8e3ad commit e4143b0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr,
cdev);
}
mutex_unlock(&thermal_list_lock);
if (!tz->passive_delay)
tz->passive_delay = 1000;
} else if (!state && tz->forced_passive) {
mutex_lock(&thermal_list_lock);
list_for_each_entry(cdev, &thermal_cdev_list, node) {
Expand All @@ -251,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr,
cdev);
}
mutex_unlock(&thermal_list_lock);
tz->passive_delay = 0;
}

tz->tc1 = 1;
tz->tc2 = 1;

if (!tz->passive_delay)
tz->passive_delay = 1000;

if (!tz->polling_delay)
tz->polling_delay = 10000;

tz->forced_passive = state;

thermal_zone_device_update(tz);
Expand Down

0 comments on commit e4143b0

Please sign in to comment.