public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 03/15] powernow-k7: Work when kernel is compiled for SMP
@ 2006-01-04 21:59 Ben Collins
  2006-01-04 22:26 ` Dominik Brodowski
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Collins @ 2006-01-04 21:59 UTC (permalink / raw)
  To: linux-kernel

On a UP system with SMP compiled kernel, the powernow-k7 module would not
initialize (returned -ENODEV). Not sure why policy->cpu != 0 for UP
systems, but since policy->cpu isn't used anywhere, just check for
num_cpus in the system, and fail of it's > 1.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>

---

 arch/i386/kernel/cpu/cpufreq/powernow-k7.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

a1418b50daac86ff02e0d7a4cba6185a452ca393
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index edcd626..a9c4970 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -576,9 +576,6 @@ static int __init powernow_cpu_init (str
 	union msr_fidvidstatus fidvidstatus;
 	int result;
 
-	if (policy->cpu != 0)
-		return -ENODEV;
-
 	rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
 
 	/* recalibrate cpu_khz */
@@ -664,8 +661,13 @@ static struct cpufreq_driver powernow_dr
 
 static int __init powernow_init (void)
 {
-	if (check_powernow()==0)
+	/* Does not support multi-cpu systems */
+	if (num_online_cpus() != 1 || num_possible_cpus() != 1)
 		return -ENODEV;
+
+	if (check_powernow() == 0)
+		return -ENODEV;
+
 	return cpufreq_register_driver(&powernow_driver);
 }
 
-- 
1.0.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-05 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-04 21:59 [PATCH 03/15] powernow-k7: Work when kernel is compiled for SMP Ben Collins
2006-01-04 22:26 ` Dominik Brodowski
2006-01-04 22:32   ` Ben Collins
2006-01-05 22:32     ` Dominik Brodowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox