aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9073ada88835..5d3893558cf7 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) {
@@ -575,7 +577,23 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
575 577
576static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) 578static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
577{ 579{
578 return acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT); 580 int i, valid, ret = acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);
581
582 if (ret)
583 return ret;
584
585 valid = tz->trips.critical.flags.valid |
586 tz->trips.hot.flags.valid |
587 tz->trips.passive.flags.valid;
588
589 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++)
590 valid |= tz->trips.active[i].flags.valid;
591
592 if (!valid) {
593 printk(KERN_WARNING FW_BUG "No valid trip found\n");
594 return -ENODEV;
595 }
596 return 0;
579} 597}
580 598
581static void acpi_thermal_check(void *data) 599static void acpi_thermal_check(void *data)