aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-05-31 19:03:48 -0700
committerDave Jones <davej@redhat.com>2005-05-31 19:03:48 -0700
commitc11420a616039e2181e4ecbffb4d125d39e6877d (patch)
tree413a30af85846567ea326d42e38ba40153b73bce /drivers/cpufreq
parent3d5ee9e55d13de28d2fa58d6e13f2e4d3a5f8b1a (diff)
downloadkernel_samsung_aries-c11420a616039e2181e4ecbffb4d125d39e6877d.zip
kernel_samsung_aries-c11420a616039e2181e4ecbffb4d125d39e6877d.tar.gz
kernel_samsung_aries-c11420a616039e2181e4ecbffb4d125d39e6877d.tar.bz2
[CPUFREQ] Prevents un-necessary cpufreq changes if we are already at min/max
Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 7d72443..6dc8380 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -333,6 +333,10 @@ static void dbs_check_cpu(int cpu)
usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
if (idle_ticks < up_idle_ticks) {
+ /* if we are already at full speed then break out early */
+ if (policy->cur == policy->max)
+ return;
+
__cpufreq_driver_target(policy, policy->max,
CPUFREQ_RELATION_H);
down_skip[cpu] = 0;
@@ -386,6 +390,10 @@ static void dbs_check_cpu(int cpu)
usecs_to_jiffies(freq_down_sampling_rate);
if (idle_ticks > down_idle_ticks ) {
+ /* if we are already at the lowest speed then break out early */
+ if (policy->cur == policy->min)
+ return;
+
freq_down_step = (5 * policy->max) / 100;
/* max freq cannot be less than 100. But who knows.... */