Skip to contentSkip to conversation

speedstep-smi: only allow it to run on mobile Intel Pentium III

PATCH Applied Dominik Brodowski 2 participants 2 messages Sep 3, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 speedstep-smi: only allow it to run on mobile Intel Pentium III

speedstep-smi only makes sense on Intel mobile Pentium III systems. So, unify the distributed checks for speedstep_processor there, and disallow P4s.

 arch/i386/kernel/cpu/cpufreq/speedstep-smi.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)
arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +12 -13
diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -260,12 +260,6 @@
 	if (result) {
 		/* fall back to speedstep_lib.c dection mechanism: try both states out */
 		dprintk(KERN_INFO PFX "could not detect low and high frequencies by SMI call.\n");
-		if (!speedstep_processor)
-			speedstep_processor = speedstep_detect_processor();
-
-		if (!speedstep_processor)
-			return -ENODEV;
-
 		result = speedstep_get_freqs(speedstep_processor,
 				&speedstep_freqs[SPEEDSTEP_LOW].frequency,
 				&speedstep_freqs[SPEEDSTEP_HIGH].frequency,
@@ -310,10 +304,6 @@
 {
 	if (cpu)
 		return -ENODEV;
-	if (!speedstep_processor)
-		speedstep_processor = speedstep_detect_processor();
-	if (!speedstep_processor)
-		return 0;
 	return speedstep_get_processor_frequency(speedstep_processor);
 }
 
@@ -354,10 +344,19 @@
  */
 static int __init speedstep_init(void)
 {
-    struct cpuinfo_x86 *c = cpu_data;
+	speedstep_processor = speedstep_detect_processor();
+
+	switch (speedstep_processor) {
+	case SPEEDSTEP_PROCESSOR_PIII_T:
+        case SPEEDSTEP_PROCESSOR_PIII_C:
+        case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
+		break;
+	default:
+		speedstep_processor = 0;
+	}
 
-    if (c->x86_vendor != X86_VENDOR_INTEL) {
-		printk (KERN_INFO PFX "No Intel CPU detected.\n");
+	if (!speedstep_processor) {
+		dprintk (KERN_INFO PFX "No supported Intel CPU detected.\n");
 		return -ENODEV;
 	}
Applied
#1 lore raw
Quoted 8 lines · Dominik Brodowski

speedstep-smi only makes sense on Intel mobile Pentium III systems. So, unify the distributed checks for speedstep_processor there, and disallow P4s.

 arch/i386/kernel/cpu/cpufreq/speedstep-smi.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

Applied.

arch/i386/kernel/cpu/cpufreq/speedstep-smi.c line 353

Quoted 5 lines
arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +5 -0
+	switch (speedstep_processor) {
+	case SPEEDSTEP_PROCESSOR_PIII_T:
+        case SPEEDSTEP_PROCESSOR_PIII_C:
+        case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
+		break;

Careful with indentation 8-) I fixed this up..

Dave