]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Check for MCE ability before checking registers.
authorDave Jones <davej@redhat.com>
Wed, 21 Jan 2004 02:32:03 +0000 (18:32 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 21 Jan 2004 02:32:03 +0000 (18:32 -0800)
Here's a novel idea, check the CPU has machine check capabilities
before we start polling registers.

I was wondering why my VIA C3 was starting this.  Who knows it may solve
some of the random crashes I saw there.

arch/i386/kernel/cpu/mcheck/non-fatal.c

index 204192b166f93742f1445c1f4cb46e2c5e764e33..46dd17daa174f43ab44304a416b068f2b72d677a 100644 (file)
@@ -74,6 +74,16 @@ static void mce_timerfunc (unsigned long data)
 
 static int __init init_nonfatal_mce_checker(void)
 {
+       struct cpuinfo_x86 *c = &boot_cpu_data;
+
+       /* Check for MCE support */
+       if (!cpu_has(c, X86_FEATURE_MCE))
+               return -ENODEV;
+
+       /* Check for PPro style MCA */
+       if (!cpu_has(c, X86_FEATURE_MCA))
+               return -ENODEV;
+
        /* Some Athlons misbehave when we frob bank 0 */
        if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
                boot_cpu_data.x86 == 6)