From aa6676efa5d432614af32529ac0c29c1099add6b Mon Sep 17 00:00:00 2001 From: Connor O'Brien Date: Mon, 11 Feb 2019 18:07:54 -0800 Subject: [PATCH] cpufreq: schedutil: fix check for stale utilization values Part of the fix from commit d86ab9cff8b9 ("cpufreq: schedutil: use now as reference when aggregating shared policy requests") is reversed in commit 05d2ca242067 ("cpufreq: schedutil: Ignore CPU load older than WALT window size") due to a porting mistake. Restore it while keeping the relevant change from the latter patch. Bug: 117438867 Test: build & boot Change-Id: I21399be760d7c8e2fff6c158368a285dc6261647 Signed-off-by: Connor O'Brien Signed-off-by: Alexander Winkowski --- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 84869863e965..43d2471e0261 100755 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -356,7 +356,6 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time) { struct sugov_policy *sg_policy = sg_cpu->sg_policy; struct cpufreq_policy *policy = sg_policy->policy; - u64 last_freq_update_time = sg_policy->last_freq_update_time; unsigned long util = 0, max = 1; unsigned int j; @@ -372,7 +371,7 @@ static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time) * enough, don't take the CPU into account as it probably is * idle now (and clear iowait_boost for it). */ - delta_ns = last_freq_update_time - j_sg_cpu->last_update; + delta_ns = time - j_sg_cpu->last_update; if (delta_ns > stale_ns) { j_sg_cpu->iowait_boost = 0; j_sg_cpu->iowait_boost_pending = false;