diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2007-08-22 21:44:20 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-10-04 18:40:56 -0400 |
commit | c925401b6dc2229adbb15b2f3c9f0f2d9253a5d5 (patch) | |
tree | 8cac9908818a1761babf512ed9ffaa08b7c92160 /arch | |
parent | 804b3f9a16e446cb023417faec58b6506c834052 (diff) |
[CPUFREQ] x86: use num_online_nodes to get physical cpus numbers for
powernow_k8
[PATCH] x86: use num_online_nodes to get physical cpus numbers for powernow_k8
For opteron based system, don't assume all physical cpus have the same booted cpus even same cores. esp for downcore case.
Signed-off-by: Yinghai Lu <yinghai.sun.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 34ed53a06730..372df6e67e89 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1325,21 +1325,16 @@ static struct cpufreq_driver cpufreq_amd64_driver = { | |||
1325 | static int __cpuinit powernowk8_init(void) | 1325 | static int __cpuinit powernowk8_init(void) |
1326 | { | 1326 | { |
1327 | unsigned int i, supported_cpus = 0; | 1327 | unsigned int i, supported_cpus = 0; |
1328 | unsigned int booted_cores = 1; | ||
1329 | 1328 | ||
1330 | for_each_online_cpu(i) { | 1329 | for_each_online_cpu(i) { |
1331 | if (check_supported_cpu(i)) | 1330 | if (check_supported_cpu(i)) |
1332 | supported_cpus++; | 1331 | supported_cpus++; |
1333 | } | 1332 | } |
1334 | 1333 | ||
1335 | #ifdef CONFIG_SMP | ||
1336 | booted_cores = cpu_data[0].booted_cores; | ||
1337 | #endif | ||
1338 | |||
1339 | if (supported_cpus == num_online_cpus()) { | 1334 | if (supported_cpus == num_online_cpus()) { |
1340 | printk(KERN_INFO PFX "Found %d %s " | 1335 | printk(KERN_INFO PFX "Found %d %s " |
1341 | "processors (%d cpu cores) (" VERSION ")\n", | 1336 | "processors (%d cpu cores) (" VERSION ")\n", |
1342 | supported_cpus/booted_cores, | 1337 | num_online_nodes(), |
1343 | boot_cpu_data.x86_model_id, supported_cpus); | 1338 | boot_cpu_data.x86_model_id, supported_cpus); |
1344 | return cpufreq_register_driver(&cpufreq_amd64_driver); | 1339 | return cpufreq_register_driver(&cpufreq_amd64_driver); |
1345 | } | 1340 | } |