diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-10-02 09:31:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-02 09:42:19 -0400 |
commit | 0d18b2e34bd1ad8f5bd3f3a17b5e7df132e511a9 (patch) | |
tree | ec8968797976e386245fb383a5cee800b6b75140 /drivers/edac/edac_mce_amd.c | |
parent | 329bd4119c8a0afea95f9db6d6b402a2f2b40e84 (diff) |
x86: EDAC: carve out AMD MCE decoding logic
This converts the MCE decoding logic into a standalone config
option which can be built-in or a module, the first one being the
default for MCEs happening early on in the boot process.
This, beyond being separated in a cleaner way, also saves RAM by
making the decoding logic modular.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <20091002133148.GD28682@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/edac/edac_mce_amd.c')
-rw-r--r-- | drivers/edac/edac_mce_amd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index 83a01a1187d7..713ed7d37247 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | static bool report_gart_errors; | 4 | static bool report_gart_errors; |
5 | static void (*nb_bus_decoder)(int node_id, struct err_regs *regs); | 5 | static void (*nb_bus_decoder)(int node_id, struct err_regs *regs); |
6 | static void (*orig_mce_callback)(struct mce *m); | ||
6 | 7 | ||
7 | void amd_report_gart_errors(bool v) | 8 | void amd_report_gart_errors(bool v) |
8 | { | 9 | { |
@@ -427,9 +428,25 @@ static int __init mce_amd_init(void) | |||
427 | * We can decode MCEs for Opteron and later CPUs: | 428 | * We can decode MCEs for Opteron and later CPUs: |
428 | */ | 429 | */ |
429 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && | 430 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && |
430 | (boot_cpu_data.x86 >= 0xf)) | 431 | (boot_cpu_data.x86 >= 0xf)) { |
432 | /* safe the default decode mce callback */ | ||
433 | orig_mce_callback = x86_mce_decode_callback; | ||
434 | |||
431 | x86_mce_decode_callback = amd_decode_mce; | 435 | x86_mce_decode_callback = amd_decode_mce; |
436 | } | ||
432 | 437 | ||
433 | return 0; | 438 | return 0; |
434 | } | 439 | } |
435 | early_initcall(mce_amd_init); | 440 | early_initcall(mce_amd_init); |
441 | |||
442 | #ifdef MODULE | ||
443 | static void __exit mce_amd_exit(void) | ||
444 | { | ||
445 | x86_mce_decode_callback = orig_mce_callback; | ||
446 | } | ||
447 | |||
448 | MODULE_DESCRIPTION("AMD MCE decoder"); | ||
449 | MODULE_ALIAS("edac-mce-amd"); | ||
450 | MODULE_LICENSE("GPL"); | ||
451 | module_exit(mce_amd_exit); | ||
452 | #endif | ||