[PATCH] Longhaul: Check for CPU model first

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes bug 16274. This is C3 only driver, but APIC and
SMP checks are executed on any Centaur processor. Check for CPU
model first and stop produce bogus error messages on C7 and Nano
systems.

Signed-off-by: Rafal Bilski <rafalbilski@xxxxxxxxxx>
---

Please close bug 16274 if this patch is accepted.

 drivers/cpufreq/longhaul.c |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index f47d26e..f70287e 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -959,22 +959,23 @@ static int __init longhaul_init(void)
 	if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
 		return -ENODEV;
 
+	switch (c->x86_model) {
+	case 6 ... 9:
 #ifdef CONFIG_SMP
-	if (num_online_cpus() > 1) {
-		printk(KERN_ERR PFX "More than 1 CPU detected, "
-				"longhaul disabled.\n");
-		return -ENODEV;
-	}
+		if (num_online_cpus() > 1) {
+			printk(KERN_ERR PFX "More than 1 CPU detected, "
+					"longhaul disabled.\n");
+			return -ENODEV;
+		}
 #endif
 #ifdef CONFIG_X86_IO_APIC
-	if (cpu_has_apic) {
-		printk(KERN_ERR PFX "APIC detected. Longhaul is currently "
-				"broken in this configuration.\n");
-		return -ENODEV;
-	}
+		if (cpu_has_apic) {
+			printk(KERN_ERR PFX "APIC detected. Longhaul is "
+					"currently broken in this "
+					"configuration.\n");
+			return -ENODEV;
+		}
 #endif
-	switch (c->x86_model) {
-	case 6 ... 9:
 		return cpufreq_register_driver(&longhaul_driver);
 	case 10:
 		printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n");
-- 
1.7.9.4

--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux