Merge branch 'gemini_fix' of git://git.berlios.de/gemini-board into devel-stable
[sfrench/cifs-2.6.git] / arch / x86 / kernel / cpu / mcheck / mce_intel.c
index 889f665fe93d78322093505882e636feac5029ac..62b48e40920a2fe2445bc68ba562fcc2e4d8c987 100644 (file)
@@ -5,9 +5,11 @@
  * Author: Andi Kleen
  */
 
+#include <linux/gfp.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/percpu.h>
+#include <linux/sched.h>
 #include <asm/apic.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
@@ -94,7 +96,7 @@ static void cmci_discover(int banks, int boot)
 
                /* Already owned by someone else? */
                if (val & CMCI_EN) {
-                       if (test_and_clear_bit(i, owned) || boot)
+                       if (test_and_clear_bit(i, owned) && !boot)
                                print_update("SHD", &hdr, i);
                        __clear_bit(i, __get_cpu_var(mce_poll_banks));
                        continue;
@@ -106,7 +108,7 @@ static void cmci_discover(int banks, int boot)
 
                /* Did the enable bit stick? -- the bank supports CMCI */
                if (val & CMCI_EN) {
-                       if (!test_and_set_bit(i, owned) || boot)
+                       if (!test_and_set_bit(i, owned) && !boot)
                                print_update("CMCI", &hdr, i);
                        __clear_bit(i, __get_cpu_var(mce_poll_banks));
                } else {