[PATCH 2/2] omap2+: pm: cpufreq: Fix loops_per_jiffy calculation

Sanjeev Premi premi at ti.com
Fri Jun 24 06:35:42 EDT 2011


Currently, loops_per_jiffy is being calculated before calling
cpufreq_notify_transition().

However, generic cpufreq driver adjusts the jiffies as well.
Double adjustment leads to incorrect value being assigned to
loops_per_jiffy.

This manifests as incorrect BogoMIPS in "cat /proc/cpuinfo'

Signed-off-by: Sanjeev Premi <premi at ti.com>
---
 arch/arm/mach-omap2/omap2plus-cpufreq.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
index ce9d534..346519e 100644
--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
+++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
@@ -114,29 +114,13 @@ static int omap_target(struct cpufreq_policy *policy,
 
 	freqs.new = omap_getspeed(policy->cpu);
 
-	/*
-	 * In the generic cpufreq driver jiffies are updated only for
-	 * non-SMP cases. Ensure that jiffies are bing updated for both
-	 * SMP systems and UP systems built with CONFIG_SMP enabled.
-	 */
+	/* Notify transitions */
 	if (is_smp()) {
-#ifdef CONFIG_SMP
-		for_each_cpu(i, policy->cpus)
-			per_cpu(cpu_data, i).loops_per_jiffy =
-				cpufreq_scale(per_cpu(cpu_data, i).loops_per_jiffy,
-						freqs.old,
-						freqs.new);
-#endif
-		/* Notify transitions */
 		for_each_cpu(i, policy->cpus) {
 			freqs.cpu = i;
 			cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 		}
 	} else {
-		loops_per_jiffy = cpufreq_scale(loops_per_jiffy,
-					freqs.old, freqs.new);
-
-		/* Notify transitions */
 		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 	}
 
-- 
1.7.2.2




More information about the linux-arm-kernel mailing list