diff options
author | Len Brown <len.brown@intel.com> | 2009-12-15 22:35:50 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-15 22:35:50 -0500 |
commit | 1667e399a41be976c9d37bf02aa477979df111d2 (patch) | |
tree | 9b412df956905afecc15753628b608c06f9b11d7 | |
parent | abdef01daceb120ef8cc03fbc96d5e029e2810b0 (diff) | |
parent | 3767cb54ac718eb049d2a29f7a575ab923550ba5 (diff) |
Merge branch 'thermal-2.6.33' into release
-rw-r--r-- | Documentation/thermal/sysfs-api.txt | 1 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 7 | ||||
-rw-r--r-- | drivers/thermal/thermal_sys.c | 17 |
3 files changed, 19 insertions, 6 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index a87dc277a5ca..cb3d15bc1aeb 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
@@ -206,6 +206,7 @@ passive | |||
206 | passive trip point for the zone. Activation is done by polling with | 206 | passive trip point for the zone. Activation is done by polling with |
207 | an interval of 1 second. | 207 | an interval of 1 second. |
208 | Unit: millidegrees Celsius | 208 | Unit: millidegrees Celsius |
209 | Valid values: 0 (disabled) or greater than 1000 | ||
209 | RW, Optional | 210 | RW, Optional |
210 | 211 | ||
211 | ***************************** | 212 | ***************************** |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 65f67815902a..9073ada88835 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -1052,6 +1052,13 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) | |||
1052 | acpi_device_bid(device)); | 1052 | acpi_device_bid(device)); |
1053 | } | 1053 | } |
1054 | seq_puts(seq, "\n"); | 1054 | seq_puts(seq, "\n"); |
1055 | } else { | ||
1056 | seq_printf(seq, "passive (forced):"); | ||
1057 | if (tz->thermal_zone->forced_passive) | ||
1058 | seq_printf(seq, " %i C\n", | ||
1059 | tz->thermal_zone->forced_passive / 1000); | ||
1060 | else | ||
1061 | seq_printf(seq, "<not set>\n"); | ||
1055 | } | 1062 | } |
1056 | 1063 | ||
1057 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { | 1064 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 6f8d8f971212..3bc72ea57e09 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -225,6 +225,12 @@ passive_store(struct device *dev, struct device_attribute *attr, | |||
225 | if (!sscanf(buf, "%d\n", &state)) | 225 | if (!sscanf(buf, "%d\n", &state)) |
226 | return -EINVAL; | 226 | return -EINVAL; |
227 | 227 | ||
228 | /* sanity check: values below 1000 millicelcius don't make sense | ||
229 | * and can cause the system to go into a thermal heart attack | ||
230 | */ | ||
231 | if (state && state < 1000) | ||
232 | return -EINVAL; | ||
233 | |||
228 | if (state && !tz->forced_passive) { | 234 | if (state && !tz->forced_passive) { |
229 | mutex_lock(&thermal_list_lock); | 235 | mutex_lock(&thermal_list_lock); |
230 | list_for_each_entry(cdev, &thermal_cdev_list, node) { | 236 | list_for_each_entry(cdev, &thermal_cdev_list, node) { |
@@ -235,6 +241,8 @@ passive_store(struct device *dev, struct device_attribute *attr, | |||
235 | cdev); | 241 | cdev); |
236 | } | 242 | } |
237 | mutex_unlock(&thermal_list_lock); | 243 | mutex_unlock(&thermal_list_lock); |
244 | if (!tz->passive_delay) | ||
245 | tz->passive_delay = 1000; | ||
238 | } else if (!state && tz->forced_passive) { | 246 | } else if (!state && tz->forced_passive) { |
239 | mutex_lock(&thermal_list_lock); | 247 | mutex_lock(&thermal_list_lock); |
240 | list_for_each_entry(cdev, &thermal_cdev_list, node) { | 248 | list_for_each_entry(cdev, &thermal_cdev_list, node) { |
@@ -245,17 +253,12 @@ passive_store(struct device *dev, struct device_attribute *attr, | |||
245 | cdev); | 253 | cdev); |
246 | } | 254 | } |
247 | mutex_unlock(&thermal_list_lock); | 255 | mutex_unlock(&thermal_list_lock); |
256 | tz->passive_delay = 0; | ||
248 | } | 257 | } |
249 | 258 | ||
250 | tz->tc1 = 1; | 259 | tz->tc1 = 1; |
251 | tz->tc2 = 1; | 260 | tz->tc2 = 1; |
252 | 261 | ||
253 | if (!tz->passive_delay) | ||
254 | tz->passive_delay = 1000; | ||
255 | |||
256 | if (!tz->polling_delay) | ||
257 | tz->polling_delay = 10000; | ||
258 | |||
259 | tz->forced_passive = state; | 262 | tz->forced_passive = state; |
260 | 263 | ||
261 | thermal_zone_device_update(tz); | 264 | thermal_zone_device_update(tz); |
@@ -1016,6 +1019,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) | |||
1016 | thermal_zone_device_set_polling(tz, tz->passive_delay); | 1019 | thermal_zone_device_set_polling(tz, tz->passive_delay); |
1017 | else if (tz->polling_delay) | 1020 | else if (tz->polling_delay) |
1018 | thermal_zone_device_set_polling(tz, tz->polling_delay); | 1021 | thermal_zone_device_set_polling(tz, tz->polling_delay); |
1022 | else | ||
1023 | thermal_zone_device_set_polling(tz, 0); | ||
1019 | mutex_unlock(&tz->lock); | 1024 | mutex_unlock(&tz->lock); |
1020 | } | 1025 | } |
1021 | EXPORT_SYMBOL(thermal_zone_device_update); | 1026 | EXPORT_SYMBOL(thermal_zone_device_update); |