Skip to content

Commit

Permalink
ACPI thermal: Check for thermal zone requirement
Browse files Browse the repository at this point in the history
ACPI spec says (11.5 Thermal Zone Interface Requirements):
   A thermal zone must contain at least one trip point
   (critical, near critical, active, or passive)

Check this once at init time.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Tested-by: clarkt@cnsp.com
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Thomas Renninger authored and Len Brown committed Feb 19, 2010
1 parent f8b55f2 commit 8b7ef6d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,23 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)

static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
{
return acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);
int i, valid, ret = acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);

if (ret)
return ret;

valid = tz->trips.critical.flags.valid |
tz->trips.hot.flags.valid |
tz->trips.passive.flags.valid;

for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++)
valid |= tz->trips.active[i].flags.valid;

if (!valid) {
printk(KERN_WARNING FW_BUG "No valid trip found\n");
return -ENODEV;
}
return 0;
}

static void acpi_thermal_check(void *data)
Expand Down

0 comments on commit 8b7ef6d

Please sign in to comment.