summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2014-10-27 22:24:50 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:04:02 -0700
commit5ae8212edac06bc4f8d8051be3b8e16406dd472a (patch)
tree2853bbde1531ce2f0a35a2f3740b511e0824fe45 /drivers/devfreq
parent8f76ceeddbfc7ad97946e2fb065cde97689b7e80 (diff)
PM / devfreq: fix scaling down logic for simple clock scaling
When "simple_scaling" flag is enabled for on demand governor then clocks should be scaled up when the load is more than up threshold and should be scaled down when load is less than the up threshold minus down differential threshold. But currently governor is only scaling down when load is less than the down differential threshold which is definitely not intentional. This change fixes the above bug. Change-Id: If2a234155c12989dc0df397cd84eef4a759ecdfc Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [junjiew@codeaurora.org: resolved trivial conflicts] Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/governor_simpleondemand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
index b9b973987d3a..6200e14ccc19 100644
--- a/drivers/devfreq/governor_simpleondemand.c
+++ b/drivers/devfreq/governor_simpleondemand.c
@@ -58,7 +58,8 @@ static int devfreq_simple_ondemand_func(struct devfreq *df,
stat->total_time * dfso_upthreshold)
*freq = max;
else if (stat->busy_time * 100 <
- stat->total_time * dfso_downdifferential)
+ stat->total_time *
+ (dfso_upthreshold - dfso_downdifferential))
*freq = min;
else
*freq = df->previous_freq;