thermal: bang-bang governor: act on lower trip boundary
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 20 May 2015 13:20:41 +0000 (15:20 +0200)
committerCaesar Wang <wxt@rock-chips.com>
Tue, 26 Apr 2016 02:36:08 +0000 (10:36 +0800)
With interrupt driven thermal zones we pass the lower and upper temperature
on which shall be acted, so in the governor we have to act on the exact lower
temperature to be consistent. Otherwise an interrupt may be generated on the
exact lower temperature, but the bang bang governor does not react.

Change-Id: Ic9dd855b0767d34b15505c1ff12ea99b76cdcea7
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
drivers/thermal/gov_bang_bang.c

index 70836c5b89bc411d3a1b91ebea91c3b8f92b4dba..9d1dfea6808f7defe49ccd521e96b8518d15ead6 100644 (file)
@@ -59,7 +59,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
                if (instance->target == 0 && tz->temperature >= trip_temp)
                        instance->target = 1;
                else if (instance->target == 1 &&
-                               tz->temperature < trip_temp - trip_hyst)
+                               tz->temperature <= trip_temp - trip_hyst)
                        instance->target = 0;
 
                dev_dbg(&instance->cdev->device, "target=%d\n",