sched/power: max allowed state capping fixed
authorLukasz Luba <l.luba@partner.samsung.com>
Tue, 13 Nov 2018 17:23:43 +0000 (18:23 +0100)
committerLukasz Luba <l.luba@partner.samsung.com>
Fri, 17 May 2019 07:15:54 +0000 (09:15 +0200)
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
kernel/sched/power.c

index cf56484f95ca60b2532a2c945e29efead9043ce9..923f689860d1d08652ab310df52b05831fa79c29 100644 (file)
@@ -656,7 +656,10 @@ static int cooling_dev_set_state(struct _thermal_zone *zone,
                /* we treat single-cooling-dev-zone as a guard for max temp */
                cooling->max_single_state = target;
        } else {
-               if (cooling->max_single_state < target) {
+               /* Lower 'target' state means higer frequency. Prevent going to
+                * higer freq if there was a limit due temperature value
+                * from sensor closer to the device. */
+               if (cooling->max_single_state > target) {
                        target = cooling->max_single_state;
                        ret = -EAGAIN;
                }