x86/mce: Kill drain_mcelog_buffer()
authorBorislav Petkov <bp@suse.de>
Wed, 12 Aug 2015 16:29:38 +0000 (18:29 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 13 Aug 2015 08:12:52 +0000 (10:12 +0200)
This used to flush out MCEs logged during early boot and which
were in the MCA registers from a previous system run. No need
for that now, since we've moved to a genpool.

Suggested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1439396985-12812-7-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mcheck/mce.c
drivers/acpi/acpi_extlog.c
drivers/edac/i7core_edac.c
drivers/edac/mce_amd.c
drivers/edac/sb_edac.c

index dfaa4de1dbb4f8a5ce1bcf3d0e4f73ca24595be3..982dfc3679ad3d9cd741d75f8799bc1b8b8c5ef7 100644 (file)
@@ -140,7 +140,7 @@ struct mce_vendor_flags {
 extern struct mce_vendor_flags mce_flags;
 
 extern struct mca_config mca_cfg;
-extern void mce_register_decode_chain(struct notifier_block *nb, bool drain);
+extern void mce_register_decode_chain(struct notifier_block *nb);
 extern void mce_unregister_decode_chain(struct notifier_block *nb);
 
 #include <linux/percpu.h>
index 9568bb55bfe2f896801bda014c6f408cbc768d97..32b586ee006a66c6661af61f92b45c4df608cc2f 100644 (file)
@@ -199,55 +199,15 @@ void mce_log(struct mce *mce)
        set_bit(0, &mce_need_notify);
 }
 
-static void drain_mcelog_buffer(void)
-{
-       unsigned int next, i, prev = 0;
-
-       next = ACCESS_ONCE(mcelog.next);
-
-       do {
-               struct mce *m;
-
-               /* drain what was logged during boot */
-               for (i = prev; i < next; i++) {
-                       unsigned long start = jiffies;
-                       unsigned retries = 1;
-
-                       m = &mcelog.entry[i];
-
-                       while (!m->finished) {
-                               if (time_after_eq(jiffies, start + 2*retries))
-                                       retries++;
-
-                               cpu_relax();
-
-                               if (!m->finished && retries >= 4) {
-                                       pr_err("skipping error being logged currently!\n");
-                                       break;
-                               }
-                       }
-                       smp_rmb();
-                       atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m);
-               }
-
-               memset(mcelog.entry + prev, 0, (next - prev) * sizeof(*m));
-               prev = next;
-               next = cmpxchg(&mcelog.next, prev, 0);
-       } while (next != prev);
-}
-
 static struct notifier_block mce_srao_nb;
 
-void mce_register_decode_chain(struct notifier_block *nb, bool drain)
+void mce_register_decode_chain(struct notifier_block *nb)
 {
        /* Ensure SRAO notifier has the highest priority in the decode chain. */
        if (nb != &mce_srao_nb && nb->priority == INT_MAX)
                nb->priority -= 1;
 
        atomic_notifier_chain_register(&x86_mce_decoder_chain, nb);
-
-       if (drain)
-               drain_mcelog_buffer();
 }
 EXPORT_SYMBOL_GPL(mce_register_decode_chain);
 
@@ -2028,7 +1988,7 @@ __setup("mce", mcheck_enable);
 int __init mcheck_init(void)
 {
        mcheck_intel_therm_init();
-       mce_register_decode_chain(&mce_srao_nb, false);
+       mce_register_decode_chain(&mce_srao_nb);
        mcheck_vendor_init_severity();
 
        INIT_WORK(&mce_work, mce_process_work);
index 07e012e74c1bbe4dab50adcb7d33b58dc1b4ff45..b3842ffc19ba20a210bec8dd8dc5f56cf9119de9 100644 (file)
@@ -286,7 +286,7 @@ static int __init extlog_init(void)
         */
        old_edac_report_status = get_edac_report_status();
        set_edac_report_status(EDAC_REPORTING_DISABLED);
-       mce_register_decode_chain(&extlog_mce_dec, true);
+       mce_register_decode_chain(&extlog_mce_dec);
        /* enable OS to be involved to take over management from BIOS */
        ((struct extlog_l1_head *)extlog_l1_addr)->flags |= FLAG_OS_OPTIN;
 
index 13d77f4a892c7244dcaac13ec3ddce1c95759325..01087a38da226d08bd7e08da5a183885fbf420b1 100644 (file)
@@ -2424,7 +2424,7 @@ static int __init i7core_init(void)
        pci_rc = pci_register_driver(&i7core_driver);
 
        if (pci_rc >= 0) {
-               mce_register_decode_chain(&i7_mce_dec, true);
+               mce_register_decode_chain(&i7_mce_dec);
                return 0;
        }
 
index aca31a2370732cd74cc6cee2c4c925c180fc02ba..58586d59bf8ed2ff2b7a7abf20288105da43f2d3 100644 (file)
@@ -895,7 +895,7 @@ static int __init mce_amd_init(void)
 
        pr_info("MCE: In-kernel MCE decoding enabled.\n");
 
-       mce_register_decode_chain(&amd_mce_dec_nb, true);
+       mce_register_decode_chain(&amd_mce_dec_nb);
 
        return 0;
 }
index 5780e26c3e5845c665bd684bb6f833a252436830..ca7831168298a444d1b2dd55fbdec48a287b5ab1 100644 (file)
@@ -2591,7 +2591,7 @@ static int __init sbridge_init(void)
 
        pci_rc = pci_register_driver(&sbridge_driver);
        if (pci_rc >= 0) {
-               mce_register_decode_chain(&sbridge_mce_dec, true);
+               mce_register_decode_chain(&sbridge_mce_dec);
                if (get_edac_report_status() == EDAC_REPORTING_DISABLED)
                        sbridge_printk(KERN_WARNING, "Loading driver, error reporting disabled.\n");
                return 0;