aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2009-01-16 12:53:42 -0500
committerLen Brown <len.brown@intel.com>2009-01-16 14:13:12 -0500
commit0e4240d94628530a912d216cad1e32d2e3827327 (patch)
tree6c0e965923e5e761a5df7f981209292a808d4f0e
parentc59765042f53a79a7a65585042ff463b69cb248c (diff)
thermal fixup for broken BIOS which has invalid trip points.
ACPI thermal driver only re-evaluate VALID trip points. For the broken BIOS show in http://bugzilla.kernel.org/show_bug.cgi?id=8544 the active[0] is set to invalid at boot time and it will not be re-evaluated again. We can still get a single warning message at boot time. http://marc.info/?l=linux-kernel&m=120496222629983&w=2 http://bugzilla.kernel.org/show_bug.cgi?id=12203 Signed-off-by: Zhang Rui<rui.zhang@intel.com> Tested-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/thermal.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 073ff09218a9..99e6f1f8ea45 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -416,7 +416,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
416 } 416 }
417 417
418 /* Passive (optional) */ 418 /* Passive (optional) */
419 if (flag & ACPI_TRIPS_PASSIVE) { 419 if (((flag & ACPI_TRIPS_PASSIVE) && tz->trips.passive.flags.valid) ||
420 (flag == ACPI_TRIPS_INIT)) {
420 valid = tz->trips.passive.flags.valid; 421 valid = tz->trips.passive.flags.valid;
421 if (psv == -1) { 422 if (psv == -1) {
422 status = AE_SUPPORT; 423 status = AE_SUPPORT;
@@ -462,8 +463,11 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
462 memset(&devices, 0, sizeof(struct acpi_handle_list)); 463 memset(&devices, 0, sizeof(struct acpi_handle_list));
463 status = acpi_evaluate_reference(tz->device->handle, "_PSL", 464 status = acpi_evaluate_reference(tz->device->handle, "_PSL",
464 NULL, &devices); 465 NULL, &devices);
465 if (ACPI_FAILURE(status)) 466 if (ACPI_FAILURE(status)) {
467 printk(KERN_WARNING PREFIX
468 "Invalid passive threshold\n");
466 tz->trips.passive.flags.valid = 0; 469 tz->trips.passive.flags.valid = 0;
470 }
467 else 471 else
468 tz->trips.passive.flags.valid = 1; 472 tz->trips.passive.flags.valid = 1;
469 473
@@ -487,7 +491,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
487 if (act == -1) 491 if (act == -1)
488 break; /* disable all active trip points */ 492 break; /* disable all active trip points */
489 493
490 if (flag & ACPI_TRIPS_ACTIVE) { 494 if ((flag == ACPI_TRIPS_INIT) || ((flag & ACPI_TRIPS_ACTIVE) &&
495 tz->trips.active[i].flags.valid)) {
491 status = acpi_evaluate_integer(tz->device->handle, 496 status = acpi_evaluate_integer(tz->device->handle,
492 name, NULL, &tmp); 497 name, NULL, &tmp);
493 if (ACPI_FAILURE(status)) { 498 if (ACPI_FAILURE(status)) {
@@ -521,8 +526,11 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
521 memset(&devices, 0, sizeof(struct acpi_handle_list)); 526 memset(&devices, 0, sizeof(struct acpi_handle_list));
522 status = acpi_evaluate_reference(tz->device->handle, 527 status = acpi_evaluate_reference(tz->device->handle,
523 name, NULL, &devices); 528 name, NULL, &devices);
524 if (ACPI_FAILURE(status)) 529 if (ACPI_FAILURE(status)) {
530 printk(KERN_WARNING PREFIX
531 "Invalid active%d threshold\n", i);
525 tz->trips.active[i].flags.valid = 0; 532 tz->trips.active[i].flags.valid = 0;
533 }
526 else 534 else
527 tz->trips.active[i].flags.valid = 1; 535 tz->trips.active[i].flags.valid = 1;
528 536