Skip to content

Commit

Permalink
[CPUFREQ] Prevents un-necessary cpufreq changes if we are already at …
Browse files Browse the repository at this point in the history
…min/max

Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Dave Jones committed Jun 1, 2005
1 parent 3d5ee9e commit c11420a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.... */
Expand Down

0 comments on commit c11420a

Please sign in to comment.