aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mce_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_mce_amd.c')
-rw-r--r--drivers/edac/edac_mce_amd.c19
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
4static bool report_gart_errors; 4static bool report_gart_errors;
5static void (*nb_bus_decoder)(int node_id, struct err_regs *regs); 5static void (*nb_bus_decoder)(int node_id, struct err_regs *regs);
6static void (*orig_mce_callback)(struct mce *m);
6 7
7void amd_report_gart_errors(bool v) 8void 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}
435early_initcall(mce_amd_init); 440early_initcall(mce_amd_init);
441
442#ifdef MODULE
443static void __exit mce_amd_exit(void)
444{
445 x86_mce_decode_callback = orig_mce_callback;
446}
447
448MODULE_DESCRIPTION("AMD MCE decoder");
449MODULE_ALIAS("edac-mce-amd");
450MODULE_LICENSE("GPL");
451module_exit(mce_amd_exit);
452#endif