Skip to contentSkip to conversation

Longhaul - Protect user from himself

PATCH In review Rafał Bilski 2 participants 2 messages Jul 3, 2006 – Jul 6, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Longhaul - Protect user from himself

This patch depens on "Longhaul - Use hardware support".

Older CPU's require transition time >=1ms. Print message for C7 user (this is based on real story).

---

arch/i386/kernel/cpu/cpufreq/longhaul.c renamed from arch/i386/kernel/cpu/cpufreq/longhaul.c.orig +10 -2
@@ -633,6 +633,13 @@ static int __init longhaul_cpu_init(stru
 		break;
 	};
 
+#if (CONFIG_HZ > 250)
+	if (longhaul_version != TYPE_POWERSAVER) {
+		printk (KERN_INFO PFX "Timer frequency to high. Aborting\n");
+		return -EINVAL;
+	}
+#endif
+
 	ret = longhaul_get_ranges();
 	if (ret != 0)
 		return ret;
@@ -691,8 +698,9 @@ static int __init longhaul_init(void)
 	switch (c->x86_model) {
 	case 6 ... 9:
 		return cpufreq_register_driver(&longhaul_driver);
-	default:
-		printk (KERN_INFO PFX "Unknown VIA CPU. Contact [email protected]\n");
+	}
+	if (c->x86_model > 9) {
+		printk(KERN_INFO PFX "VIA C7 (or better) CPU. Use \"ACPI Processor P-States driver\".\n");
 	}
 
 	return -ENODEV;

------------------------------------------------------------------------
Zobacz, gdzie mieszka Twoja dziewczyna!
http://map24.interia.pl

#1 lore raw
Quoted 12 lines · Rafał Bilski

This patch depens on "Longhaul - Use hardware support".

Older CPU's require transition time >=1ms. Print message for C7 user (this is based on real story).

---

arch/i386/kernel/cpu/cpufreq/longhaul.c static int __init longhaul_cpu_init(stru · line 641

Quoted 9 lines
arch/i386/kernel/cpu/cpufreq/longhaul.c renamed from arch/i386/kernel/cpu/cpufreq/longhaul.c.orig +6 -0
@@ -633,6 +633,13 @@ static int __init longhaul_cpu_init(stru
 		break;
 	};
 
+#if (CONFIG_HZ > 250)
+	if (longhaul_version != TYPE_POWERSAVER) {
+		printk (KERN_INFO PFX "Timer frequency to high. Aborting\n");
+		return -EINVAL;
+	}
+#endif

This seems wrong. We should adjust the timings based on HZ to sleep for less/more instead.

arch/i386/kernel/cpu/cpufreq/longhaul.c static int __init longhaul_init(void) · line 703

Quoted 9 lines
arch/i386/kernel/cpu/cpufreq/longhaul.c renamed from arch/i386/kernel/cpu/cpufreq/longhaul.c.orig +3 -2
@@ -691,8 +698,9 @@ static int __init longhaul_init(void)
 	switch (c->x86_model) {
 	case 6 ... 9:
 		return cpufreq_register_driver(&longhaul_driver);
-	default:
-		printk (KERN_INFO PFX "Unknown VIA CPU. Contact [email protected]\n");
+	}
+	if (c->x86_model > 9) {
+		printk(KERN_INFO PFX "VIA C7 (or better) CPU. Use \"ACPI Processor P-States driver\".\n");

It can also use speedstep-centrino with some additional patches which I need to dust off.

Dave

Signature · 1 line
http://www.codemonkey.org.uk