diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-11-14 08:38:28 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-14 08:38:28 -0500 |
commit | 0c3c35e148dbc03106038dd25816fb9f3a084d86 (patch) | |
tree | 8b8cc6a027353a0f242f61362b35b0942da61b83 /drivers/edac/edac_mce_amd.c | |
parent | 50d40f187f9182ee8caa1b83f80a0e11e2226baa (diff) | |
parent | 5e08fe570c2dbabb5015c37049eb9a451e55c890 (diff) |
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'drivers/edac/edac_mce_amd.c')
-rw-r--r-- | drivers/edac/edac_mce_amd.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index 0c21c370c9d..713ed7d3724 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 | { |
@@ -362,7 +363,7 @@ static inline void amd_decode_err_code(unsigned int ec) | |||
362 | pr_warning("Huh? Unknown MCE error 0x%x\n", ec); | 363 | pr_warning("Huh? Unknown MCE error 0x%x\n", ec); |
363 | } | 364 | } |
364 | 365 | ||
365 | void decode_mce(struct mce *m) | 366 | static void amd_decode_mce(struct mce *m) |
366 | { | 367 | { |
367 | struct err_regs regs; | 368 | struct err_regs regs; |
368 | int node, ecc; | 369 | int node, ecc; |
@@ -420,3 +421,32 @@ void decode_mce(struct mce *m) | |||
420 | 421 | ||
421 | amd_decode_err_code(m->status & 0xffff); | 422 | amd_decode_err_code(m->status & 0xffff); |
422 | } | 423 | } |
424 | |||
425 | static int __init mce_amd_init(void) | ||
426 | { | ||
427 | /* | ||
428 | * We can decode MCEs for Opteron and later CPUs: | ||
429 | */ | ||
430 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && | ||
431 | (boot_cpu_data.x86 >= 0xf)) { | ||
432 | /* safe the default decode mce callback */ | ||
433 | orig_mce_callback = x86_mce_decode_callback; | ||
434 | |||
435 | x86_mce_decode_callback = amd_decode_mce; | ||
436 | } | ||
437 | |||
438 | return 0; | ||
439 | } | ||
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 | ||