[CPUFREQ] Prevents un-necessary cpufreq changes if we are already at min/max Signed-off-by: Alexander Clouter Signed-off-by: Dave Jones --- linux-2.6.12-rc3-mm3.orig/drivers/cpufreq/cpufreq_ondemand.c 2005-05-10 22:21:35.370204952 +0100 +++ linux-2.6.12-rc3-mm3/drivers/cpufreq/cpufreq_ondemand.c 2005-05-10 22:22:02.832030120 +0100 @@ -333,6 +333,10 @@ 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 @@ 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.... */