]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch
linux 3.0: refresh all patches against 3.0.7
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / cpufreq / 0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch
1 From 2dd7fe3249bc8cbabc1faa46b7a858e401cafd5a Mon Sep 17 00:00:00 2001
2 From: Colin Cross <ccross@google.com>
3 Date: Mon, 6 Jun 2011 21:05:29 -0500
4 Subject: [PATCH 17/19] OMAP2+: cpufreq: notify even with bad boot frequency
6 Sometimes, bootloaders starts up with a frequency which is not
7 in the OPP table. At cpu_init, policy->cur contains the frequency
8 we pick at boot.  It is possible that system might have fixed
9 it's boot frequency later on as part of power initialization.
10 After this condition, the first call to omap_target results in the
11 following:
13 omap_getspeed(actual device frequency) != policy->cur(frequency that
14 cpufreq thinks that the system is at), and it is possible that
15 freqs.old == freqs.new (because the governor requested a scale down).
17 We exit without triggering the notifiers in the current code, which
18 does'nt let code which depends on cpufreq_notify_transition to have
19 accurate information as to what the system frequency is.
21 Instead, we do a normal transition if policy->cur is wrong, then,
22 freqs.old will be the actual cpu frequency, freqs.new will be the
23 actual new cpu frequency and all required notifiers have the accurate
24 information.
26 Acked-by: Nishanth Menon <nm@ti.com>
27 Signed-off-by: Colin Cross <ccross@google.com>
28 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
29 ---
30  arch/arm/mach-omap2/omap2plus-cpufreq.c |    2 +-
31  1 files changed, 1 insertions(+), 1 deletions(-)
33 diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
34 index eaefa49..8598928 100644
35 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
36 +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
37 @@ -93,7 +93,7 @@ static int omap_target(struct cpufreq_policy *policy,
38         freqs.old = omap_getspeed(policy->cpu);
39         freqs.cpu = policy->cpu;
40  
41 -       if (freqs.old == freqs.new)
42 +       if (freqs.old == freqs.new && policy->cur == freqs.new)
43                 return ret;
44  
45         if (!is_smp()) {
46 -- 
47 1.6.6.1