Commit c11420a6 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Prevents un-necessary cpufreq changes if we are already at min/max

Signed-off-by: default avatarAlexander Clouter <alex-kernel@digriz.org.uk>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 3d5ee9e5
...@@ -333,6 +333,10 @@ static void dbs_check_cpu(int cpu) ...@@ -333,6 +333,10 @@ static void dbs_check_cpu(int cpu)
usecs_to_jiffies(dbs_tuners_ins.sampling_rate); usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
if (idle_ticks < up_idle_ticks) { 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_driver_target(policy, policy->max,
CPUFREQ_RELATION_H); CPUFREQ_RELATION_H);
down_skip[cpu] = 0; down_skip[cpu] = 0;
...@@ -386,6 +390,10 @@ static void dbs_check_cpu(int cpu) ...@@ -386,6 +390,10 @@ static void dbs_check_cpu(int cpu)
usecs_to_jiffies(freq_down_sampling_rate); usecs_to_jiffies(freq_down_sampling_rate);
if (idle_ticks > down_idle_ticks ) { 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; freq_down_step = (5 * policy->max) / 100;
/* max freq cannot be less than 100. But who knows.... */ /* max freq cannot be less than 100. But who knows.... */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment