From d63c24354709cd55a5086b51be7dc766bea33042 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 5 Dec 2016 19:52:35 +0530 Subject: [PATCH] devfreq: don't set last_scale for same freq In nvhost_pod_estimate_freq(), we have *freq = 0 in case we decide to keep same frequency In that case we set *freq as current frequency and then set last_scale timestamp This can result in keeping same frequency for long duration due to less delta from last_scale To fix this, return immediately in case *freq is zero and do not set last_scale timestamp Bug 200255163 Change-Id: Ie13bf54e2415c4016a101b9ea12a9abda83240fd Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1265185 Reviewed-on: http://git-master/r/1506359 (cherry picked from linux-4.9 commit be5331c94ebe9044cb67e3f622db517bfb7e28d4) Reviewed-on: https://git-master.nvidia.com/r/1770149 Reviewed-by: Mikko Perttunen GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho Tested-by: Timo Alho Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/devfreq/governor_pod_scaling.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/governor_pod_scaling.c b/drivers/devfreq/governor_pod_scaling.c index 1849a85f..d7250a17 100644 --- a/drivers/devfreq/governor_pod_scaling.c +++ b/drivers/devfreq/governor_pod_scaling.c @@ -669,8 +669,10 @@ static int nvhost_pod_estimate_freq(struct devfreq *df, msecs_to_jiffies(podgov->p_slowdown_delay)); } - if (!(*freq)) + if (!(*freq)) { *freq = dev_stat.current_frequency; + return 0; + } if (freqlist_up(podgov, *freq, 0) == dev_stat.current_frequency) return 0;