[tip:perf/mce] x86, mce: Add a global MCE init helper

From: tip-bot for Borislav Petkov
Date: Fri Oct 16 2009 - 08:58:05 EST


Commit-ID: b33a6363649f0ff83ec81597ea7fe7e688f973cb
Gitweb: http://git.kernel.org/tip/b33a6363649f0ff83ec81597ea7fe7e688f973cb
Author: Borislav Petkov <borislav.petkov@xxxxxxx>
AuthorDate: Fri, 16 Oct 2009 12:31:33 +0200
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Fri, 16 Oct 2009 14:46:50 +0200

x86, mce: Add a global MCE init helper

Add an early initcall (pre SMP) which sets up global MCE
functionality.

Signed-off-by: Borislav Petkov <borislav.petkov@xxxxxxx>
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
LKML-Reference: <1255689093-26921-2-git-send-email-borislav.petkov@xxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 68d968e..8080170 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1436,8 +1436,6 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
__mcheck_cpu_init_timer();
INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);

- if (raw_smp_processor_id() == 0)
- atomic_notifier_chain_register(&x86_mce_decoder_chain, &mce_dec_nb);
}

/*
@@ -1657,6 +1655,14 @@ static int __init mcheck_enable(char *str)
}
__setup("mce", mcheck_enable);

+static int __init mcheck_init(void)
+{
+ atomic_notifier_chain_register(&x86_mce_decoder_chain, &mce_dec_nb);
+
+ return 0;
+}
+early_initcall(mcheck_init);
+
/*
* Sysfs support
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/