]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
cpufreq: OMAP: notify even with bad boot frequency
authorColin Cross <ccross@google.com>
Tue, 7 Jun 2011 02:05:29 +0000 (21:05 -0500)
committerKevin Hilman <khilman@ti.com>
Tue, 8 Nov 2011 19:42:16 +0000 (11:42 -0800)
Sometimes, bootloaders starts up with a frequency which is not
in the OPP table. At cpu_init, policy->cur contains the frequency
we pick at boot.  It is possible that system might have fixed
it's boot frequency later on as part of power initialization.
After this condition, the first call to omap_target results in the
following:

omap_getspeed(actual device frequency) != policy->cur(frequency that
cpufreq thinks that the system is at), and it is possible that
freqs.old == freqs.new (because the governor requested a scale down).

We exit without triggering the notifiers in the current code, which
does'nt let code which depends on cpufreq_notify_transition to have
accurate information as to what the system frequency is.

Instead, we do a normal transition if policy->cur is wrong, then,
freqs.old will be the actual cpu frequency, freqs.new will be the
actual new cpu frequency and all required notifiers have the accurate
information.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Colin Cross <ccross@google.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
drivers/cpufreq/omap-cpufreq.c

index 3f5a816a64be5d60a284b3a0c812b0f54594f8eb..0a5d95c4f8ebc136ea47778e3ca04765fe45cab8 100644 (file)
@@ -97,7 +97,7 @@ static int omap_target(struct cpufreq_policy *policy,
        freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
        freqs.cpu = policy->cpu;
 
-       if (freqs.old == freqs.new)
+       if (freqs.old == freqs.new && policy->cur == freqs.new)
                return ret;
 
        /* notifiers */