diff options
author | Andi Kleen <ak@suse.de> | 2006-03-25 10:31:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:14:39 -0500 |
commit | ad90573f93533ddf1035b0468ed27b4453e50c46 (patch) | |
tree | e1c112abeea9de2943133ca22b870634c1713a66 | |
parent | 0085979006fd55ec7c2f721bdaa9af130a08d62a (diff) |
[PATCH] x86_64: Initialize powernow_data[] for all siblings
I got an oops on a dual core system because the lost tick handler
called cpufreq_get() on core 1 and powernow tried to follow
a NULL powernow_data[] pointer there.
Initialize powernow_data for all cores of a CPU.
Cc: Jacob Shin <jacob.shin@amd.com>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index d09bec71080e..e5bc06480ff9 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -54,7 +54,7 @@ static DECLARE_MUTEX(fidvid_sem); | |||
54 | static struct powernow_k8_data *powernow_data[NR_CPUS]; | 54 | static struct powernow_k8_data *powernow_data[NR_CPUS]; |
55 | 55 | ||
56 | #ifndef CONFIG_SMP | 56 | #ifndef CONFIG_SMP |
57 | static cpumask_t cpu_core_map[1]; | 57 | static cpumask_t cpu_core_map[1] = { CPU_MASK_ALL }; |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | /* Return a frequency in MHz, given an input fid */ | 60 | /* Return a frequency in MHz, given an input fid */ |
@@ -976,7 +976,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
976 | { | 976 | { |
977 | struct powernow_k8_data *data; | 977 | struct powernow_k8_data *data; |
978 | cpumask_t oldmask = CPU_MASK_ALL; | 978 | cpumask_t oldmask = CPU_MASK_ALL; |
979 | int rc; | 979 | int rc, i; |
980 | 980 | ||
981 | if (!cpu_online(pol->cpu)) | 981 | if (!cpu_online(pol->cpu)) |
982 | return -ENODEV; | 982 | return -ENODEV; |
@@ -1062,7 +1062,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1062 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1062 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", |
1063 | data->currfid, data->currvid); | 1063 | data->currfid, data->currvid); |
1064 | 1064 | ||
1065 | powernow_data[pol->cpu] = data; | 1065 | for_each_cpu_mask(i, cpu_core_map[pol->cpu]) |
1066 | powernow_data[i] = data; | ||
1066 | 1067 | ||
1067 | return 0; | 1068 | return 0; |
1068 | 1069 | ||