Skip to content

Commit 54d9400

Browse files
committed
thermal: gov_bang_bang: Fix possible cooling device state ping-pong
The current behavior of thermal_zone_trip_update() in the bang-bang thermal governor may be problematic for trip points with 0 hysteresis, because when the zone temperature reaches the trip temperature and stays there, it will then cause the cooling device go "on" and "off" alternately, which is not desirable. Address this by requiring the zone temperature to actually fall below trip->temperature - trip->hysteresis for the cooling device to go off. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent f2675e5 commit 54d9400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/gov_bang_bang.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int thermal_zone_trip_update(struct thermal_zone_device *tz,
4949
if (instance->target == 0 && tz->temperature >= trip->temperature)
5050
instance->target = 1;
5151
else if (instance->target == 1 &&
52-
tz->temperature <= trip->temperature - trip->hysteresis)
52+
tz->temperature < trip->temperature - trip->hysteresis)
5353
instance->target = 0;
5454

5555
dev_dbg(&instance->cdev->device, "target=%d\n",

0 commit comments

Comments
 (0)