From 785bfd82d3fcf4d1bbaed1bdf4fd08e8e6f7864f 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-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Wen Yi Reviewed-by: Terje Bergstrom --- 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 cca3699975dd..1347225c56fa 100644 --- a/drivers/devfreq/governor_pod_scaling.c +++ b/drivers/devfreq/governor_pod_scaling.c @@ -799,8 +799,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; -- 2.39.2