aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2010-02-20 05:44:27 -0500
committerLen Brown <len.brown@intel.com>2010-02-23 00:43:36 -0500
commitfa80945269f312bc609e8384302f58b03c916e12 (patch)
treea35b94464a24d0a597b81ab63e4af1b1930f238b /drivers/acpi/thermal.c
parent9f3a6284880ceea452903e2043c88d7226736318 (diff)
ACPI thermal: Don't invalidate thermal zone if critical trip point is bad
V2: Corrected integer/long conversion. Some BIOSes return a negative value for the critical trip point. Especially since Windows 2006... We currently invalidate the whole thermal zone in this case. But it may still be needed for cooling, also without critical trip point. This patch invalidates the critical trip point if no _CRT function is found or if it returns negative values, but does not invalidate the whole thermal zone in this case. Reference: http://bugzilla.novell.com/show_bug.cgi?id=531547 Signed-off-by: Thomas Renninger <trenn@suse.de> Tested-by: clarkt@cnsp.com Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9073ada88835..77b8e1eaa717 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -368,7 +368,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
368 int valid = 0; 368 int valid = 0;
369 int i; 369 int i;
370 370
371 /* Critical Shutdown (required) */ 371 /* Critical Shutdown */
372 if (flag & ACPI_TRIPS_CRITICAL) { 372 if (flag & ACPI_TRIPS_CRITICAL) {
373 status = acpi_evaluate_integer(tz->device->handle, 373 status = acpi_evaluate_integer(tz->device->handle,
374 "_CRT", NULL, &tmp); 374 "_CRT", NULL, &tmp);
@@ -379,17 +379,19 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
379 * Below zero (Celsius) values clearly aren't right for sure.. 379 * Below zero (Celsius) values clearly aren't right for sure..
380 * ... so lets discard those as invalid. 380 * ... so lets discard those as invalid.
381 */ 381 */
382 if (ACPI_FAILURE(status) || 382 if (ACPI_FAILURE(status)) {
383 tz->trips.critical.temperature <= 2732) { 383 tz->trips.critical.flags.valid = 0;
384 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
385 "No critical threshold\n"));
386 } else if (tmp <= 2732) {
387 printk(KERN_WARNING FW_BUG "Invalid critical threshold "
388 "(%llu)\n", tmp);
384 tz->trips.critical.flags.valid = 0; 389 tz->trips.critical.flags.valid = 0;
385 ACPI_EXCEPTION((AE_INFO, status,
386 "No or invalid critical threshold"));
387 return -ENODEV;
388 } else { 390 } else {
389 tz->trips.critical.flags.valid = 1; 391 tz->trips.critical.flags.valid = 1;
390 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 392 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
391 "Found critical threshold [%lu]\n", 393 "Found critical threshold [%lu]\n",
392 tz->trips.critical.temperature)); 394 tz->trips.critical.temperature));
393 } 395 }
394 if (tz->trips.critical.flags.valid == 1) { 396 if (tz->trips.critical.flags.valid == 1) {
395 if (crt == -1) { 397 if (crt == -1) {