Re: [PATCH 3/3] EDAC: carve out AMD MCE decoding logic

From: Ingo Molnar
Date: Fri Oct 02 2009 - 09:40:20 EST



* Borislav Petkov <borislav.petkov@xxxxxxx> 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
--
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/