]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/thermal.c
thermal fixup for broken BIOS which has invalid trip points.
[linux-2.6-omap-h63xx.git] / drivers / acpi / thermal.c
index 073ff09218a9be62ac2acc25601080b4c87976e6..99e6f1f8ea457677e1b989c711e37e1b339e60c3 100644 (file)
@@ -416,7 +416,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
        }
 
        /* Passive (optional) */
-       if (flag & ACPI_TRIPS_PASSIVE) {
+       if (((flag & ACPI_TRIPS_PASSIVE) && tz->trips.passive.flags.valid) ||
+               (flag == ACPI_TRIPS_INIT)) {
                valid = tz->trips.passive.flags.valid;
                if (psv == -1) {
                        status = AE_SUPPORT;
@@ -462,8 +463,11 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
                memset(&devices, 0, sizeof(struct acpi_handle_list));
                status = acpi_evaluate_reference(tz->device->handle, "_PSL",
                                                        NULL, &devices);
-               if (ACPI_FAILURE(status))
+               if (ACPI_FAILURE(status)) {
+                       printk(KERN_WARNING PREFIX
+                               "Invalid passive threshold\n");
                        tz->trips.passive.flags.valid = 0;
+               }
                else
                        tz->trips.passive.flags.valid = 1;
 
@@ -487,7 +491,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
                if (act == -1)
                        break; /* disable all active trip points */
 
-               if (flag & ACPI_TRIPS_ACTIVE) {
+               if ((flag == ACPI_TRIPS_INIT) || ((flag & ACPI_TRIPS_ACTIVE) &&
+                       tz->trips.active[i].flags.valid)) {
                        status = acpi_evaluate_integer(tz->device->handle,
                                                        name, NULL, &tmp);
                        if (ACPI_FAILURE(status)) {
@@ -521,8 +526,11 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
                        memset(&devices, 0, sizeof(struct acpi_handle_list));
                        status = acpi_evaluate_reference(tz->device->handle,
                                                name, NULL, &devices);
-                       if (ACPI_FAILURE(status))
+                       if (ACPI_FAILURE(status)) {
+                               printk(KERN_WARNING PREFIX
+                                       "Invalid active%d threshold\n", i);
                                tz->trips.active[i].flags.valid = 0;
+                       }
                        else
                                tz->trips.active[i].flags.valid = 1;