Skip to content

Commit

Permalink
thermal: fix off-by-1 error in trip point trigger condition
Browse files Browse the repository at this point in the history
This patch fixes a regression caused by commit
b1569e9
"ACPI: move thermal trip handling to generic thermal layer"
which accidentally changed trip point trigger condition to
  temp > trip_temp

This patch changes the trigger condition back to
  temp >= trip_temp

Signed-off-by: Vladimir Zajac <eightgraph@gmail.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Vladimir Zajac authored and Len Brown committed May 14, 2009
1 parent 091bf76 commit 2932135
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)

switch (trip_type) {
case THERMAL_TRIP_CRITICAL:
if (temp > trip_temp) {
if (temp >= trip_temp) {
if (tz->ops->notify)
ret = tz->ops->notify(tz, count,
trip_type);
Expand All @@ -974,7 +974,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
}
break;
case THERMAL_TRIP_HOT:
if (temp > trip_temp)
if (temp >= trip_temp)
if (tz->ops->notify)
tz->ops->notify(tz, count, trip_type);
break;
Expand All @@ -986,14 +986,14 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)

cdev = instance->cdev;

if (temp > trip_temp)
if (temp >= trip_temp)
cdev->ops->set_cur_state(cdev, 1);
else
cdev->ops->set_cur_state(cdev, 0);
}
break;
case THERMAL_TRIP_PASSIVE:
if (temp > trip_temp || tz->passive)
if (temp >= trip_temp || tz->passive)
thermal_zone_device_passive(tz, temp,
trip_temp, count);
break;
Expand Down

0 comments on commit 2932135

Please sign in to comment.