Messages in this thread | | | Date | Fri, 2 Oct 2009 15:39:54 +0200 | From | Ingo Molnar <> | Subject | Re: [PATCH 3/3] EDAC: carve out AMD MCE decoding logic |
| |
* Borislav Petkov <borislav.petkov@amd.com> wrote:
> +static void (*orig_mce_callback)(struct mce *m); > > void amd_report_gart_errors(bool v) > { > @@ -427,9 +428,25 @@ static int __init mce_amd_init(void) > * We can decode MCEs for Opteron and later CPUs: > */ > if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && > - (boot_cpu_data.x86 >= 0xf)) > + (boot_cpu_data.x86 >= 0xf)) { > + /* safe the default decode mce callback */ > + orig_mce_callback = x86_mce_decode_callback; > + > x86_mce_decode_callback = amd_decode_mce; > + } > > return 0; > } > early_initcall(mce_amd_init); > + > +#ifdef MODULE > +static void __exit mce_amd_exit(void) > +{ > + x86_mce_decode_callback = orig_mce_callback; > +}
I suspect this is fine currently because no two EDAC modules should be active at the same time. A followup cleanup patch would be nice nevertheless that uses a notifier chain here with proper register/unregister locking.
Ingo
| |