From 8a5e6773ed4f747829a022fbf420e6182d7c6a23 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 8 Nov 2016 16:48:42 +0530 Subject: [PATCH] devfreq: remove FREQ_DONTSCALE return if same freq In nvhost_pod_estimate_freq(), we return GET_TARGET_FREQ_DONTSCALE if new frequency is same as current frequency And based on this return value, update_devfreq() will just return without actually calling target() function But it is possible that target() function has freq clipping of its own, and skipping target() itself will break this Hence in case we find new frequency same as current frequency, do not return GET_TARGET_FREQ_DONTSCALE Instead just return 0 Note that we still return GET_TARGET_FREQ_DONTSCALE if governor itself is disabled, and this is required in perf measurement cases Bug 200245796 Change-Id: I55a3a344982c5b5441ba011cd0dd254947e89e5c Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1251841 (cherry picked from linux-4.9 commit c6417ac88eb43501b8bf6d5351059ac2dadaf2c0) Reviewed-on: https://git-master.nvidia.com/r/1770145 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 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/devfreq/governor_pod_scaling.c b/drivers/devfreq/governor_pod_scaling.c index 5f84ef3e..3ffaeb78 100644 --- a/drivers/devfreq/governor_pod_scaling.c +++ b/drivers/devfreq/governor_pod_scaling.c @@ -766,11 +766,6 @@ static int nvhost_pod_estimate_freq(struct devfreq *df, /* Do not do unnecessary scaling */ scaling_limit(df, &podgov->adjustment_frequency); - /* Round the frequency and check if we're already there */ - if (freqlist_up(podgov, podgov->adjustment_frequency, 0) == - dev_stat.current_frequency) - return GET_TARGET_FREQ_DONTSCALE; - trace_podgov_estimate_freq(df->dev.parent, df->previous_freq, podgov->adjustment_frequency); @@ -806,7 +801,7 @@ static int nvhost_pod_estimate_freq(struct devfreq *df, if (!(*freq) || (freqlist_up(podgov, *freq, 0) == dev_stat.current_frequency)) - return GET_TARGET_FREQ_DONTSCALE; + return 0; podgov->last_scale = now;