diff options
author | Jean-Christophe DUBOIS <jcd@tribudubois.net> | 2007-07-20 15:39:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 15:41:39 -0400 |
commit | 64bafa9db7e92d5a46402613188b71800924ca1f (patch) | |
tree | 8addf059b7105aa37b0c0435aaf8ef32626d4091 /arch/powerpc | |
parent | 74889e41d9a1f80928130a02af9b010673bc5ba7 (diff) |
[CELL] fix cbe_cpufreq for legacy SLOF tree.
Previous patch changed based on Christian Krafft's comment.
On some legacy SLOF tree the generic code is unable to ioremap some Cell BE
registers. Therefore the "generic" functions are returning a NULL pointer,
triggering a crash on such platforms.
Let's handle this more gracefully.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Acked-by: Christian Kraff <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/cbe_cpufreq.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index 9a9932624c0c..0b6e8ee85ab1 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/machdep.h> | 24 | #include <asm/machdep.h> |
25 | #include <asm/of_platform.h> | 25 | #include <asm/of_platform.h> |
26 | #include <asm/prom.h> | 26 | #include <asm/prom.h> |
27 | #include "cbe_regs.h" | ||
27 | #include "cbe_cpufreq.h" | 28 | #include "cbe_cpufreq.h" |
28 | 29 | ||
29 | static DEFINE_MUTEX(cbe_switch_mutex); | 30 | static DEFINE_MUTEX(cbe_switch_mutex); |
@@ -78,6 +79,15 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
78 | 79 | ||
79 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); | 80 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); |
80 | 81 | ||
82 | /* | ||
83 | * Let's check we can actually get to the CELL regs | ||
84 | */ | ||
85 | if (!cbe_get_cpu_pmd_regs(policy->cpu) || | ||
86 | !cbe_get_cpu_mic_tm_regs(policy->cpu)) { | ||
87 | pr_info("invalid CBE regs pointers for cpufreq\n"); | ||
88 | return -EINVAL; | ||
89 | } | ||
90 | |||
81 | max_freqp = of_get_property(cpu, "clock-frequency", NULL); | 91 | max_freqp = of_get_property(cpu, "clock-frequency", NULL); |
82 | 92 | ||
83 | of_node_put(cpu); | 93 | of_node_put(cpu); |