Commit 0e4240d9 authored by Zhang Rui's avatar Zhang Rui Committed by Len Brown

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: default avatarMárton Németh <nm127@freemail.hu>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c5976504
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment