Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755673AbXHWBjw (ORCPT ); Wed, 22 Aug 2007 21:39:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750908AbXHWBjp (ORCPT ); Wed, 22 Aug 2007 21:39:45 -0400 Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:36673 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbXHWBjo (ORCPT ); Wed, 22 Aug 2007 21:39:44 -0400 Date: Wed, 22 Aug 2007 18:44:20 -0700 From: Yinghai Lu Subject: [PATCH] x86: use num_online_nodes to get physical cpus numbers for powernow_k8 To: Andrew Morton , Andi Kleen , Dave Jones , Mark Langsdorf Cc: Linux Kernel Mailing List Reply-to: Yinghai Lu Message-id: <200708221844.22205.yinghai.lu@sun.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: KMail/1.8.2 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 38 [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 diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 34ed53a..372df6e 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 = { static int __cpuinit powernowk8_init(void) { unsigned int i, supported_cpus = 0; - unsigned int booted_cores = 1; for_each_online_cpu(i) { if (check_supported_cpu(i)) supported_cpus++; } -#ifdef CONFIG_SMP - booted_cores = cpu_data[0].booted_cores; -#endif - if (supported_cpus == num_online_cpus()) { printk(KERN_INFO PFX "Found %d %s " "processors (%d cpu cores) (" VERSION ")\n", - supported_cpus/booted_cores, + num_online_nodes(), boot_cpu_data.x86_model_id, supported_cpus); return cpufreq_register_driver(&cpufreq_amd64_driver); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/