Change calculation parameters
Signed-off-by: Lukasz Luba l.luba@partner.samsung.com --- kernel/sched/power.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/power.c b/kernel/sched/power.c index 327f49a670d2..c66c8dca2465 100644 --- a/kernel/sched/power.c +++ b/kernel/sched/power.c @@ -518,13 +518,14 @@ static u64 estimate_total_min_power(struct thermal_zone_device *tz, int trip) return total_min_power; }
-static u64 calc_power_budget(struct thermal_zone_device *tz, int desire_temp) +static u32 calc_power_budget(struct _thermal_zone *zone, int control_temp) { s64 temp_diff; s64 power_budget; + struct thermal_zone_device *tz = zone->tz;
/* temperature is represented in milidegress */ - temp_diff = desire_temp - tz->temperature; + temp_diff = control_temp - tz->temperature;
power_budget = temp_diff;
@@ -554,7 +555,7 @@ static struct _thermal_zone *find_zone(struct thermal_zone_device *tz)
return NULL; } -static int inject_more_idle(struct _thermal_zone *zone) +static int inject_more_idle(struct _thermal_zone *zone, u32 power_budget) {
return 0; @@ -573,6 +574,8 @@ static int sched_power_gov_throttle(struct thermal_zone_device *tz, int trip) struct thermal_cooling_device *cdev = NULL; struct thermal_instance *inst = NULL; u32 dev_power; + u32 power_budget; + int control_temp = 0; struct _thermal_zone *zone; int ret;
@@ -580,9 +583,11 @@ static int sched_power_gov_throttle(struct thermal_zone_device *tz, int trip) if (!zone) return -EINVAL;
+ if (zone->single_cooling_dev) { - /* ret = calc_power_budget(tz); */ - ret = inject_more_idle(zone); + power_budget = calc_power_budget(zone, control_temp); + /* only deadline tasks can ask for over-speed with idlers */ + ret = inject_more_idle(zone, power_budget); if (ret) { throttle_single_cdev(zone); power_actor_set_power(cdev, inst, dev_power);