lkml.org 
[lkml]   [2009]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2009-10-02 15:43    [W:0.896 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site