sched/power: do not change state for single cooling zone sandbox/lluba/thermal/v4.19/schedpower
authorLukasz Luba <l.luba@partner.samsung.com>
Wed, 14 Nov 2018 15:41:24 +0000 (16:41 +0100)
committerLukasz Luba <l.luba@partner.samsung.com>
Fri, 17 May 2019 07:17:41 +0000 (09:17 +0200)
Skip changing state when zone is single cooling, just change
the max allowed state.

Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
kernel/sched/power.c

index daee84b00b3705a245443d3fc899392945072b2f..4f69f730a7acc7b1d43c47b4cece5574043a9f51 100644 (file)
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Scheduler CPU power
+ * Scheduler CPU power allocation
  *
- *  Copyright (C) 2018 Samsung
+ * Copyright (C) 2018 Samsung Electronics co., Ltd
+ * Author: Lukasz Luba <l.luba@partner.samsung.com>
  */
 
 #define pr_fmt(fmt) "SCHED_POWER: " fmt
@@ -659,8 +660,11 @@ static int cooling_dev_set_state(struct _thermal_zone *zone,
 
        /* check if we can go with higher freq for zone with a few devices*/
        if (zone->single_cooling_dev) {
-               /* we treat single-cooling-dev-zone as a guard for max temp */
+               /* We treat single-cooling-dev-zone as a guard for max temp
+                * and which does not disturb the power split for whole chip. */
                cooling->max_single_state = target;
+               if (target < curr_state)
+                       goto skip_change;
        } else {
                /* Lower 'target' state means higer frequency. Prevent going to
                 * higer freq if there was a limit due temperature value
@@ -682,6 +686,7 @@ static int cooling_dev_set_state(struct _thermal_zone *zone,
        cdev->updated = true;
        mutex_unlock(&cdev->lock);
 
+skip_change:
        return ret;
 }