Re: [RFC PATCH 0/8] EDAC, mce_amd: Add a tracepoint for the decoded error

From: Borislav Petkov
Date: Fri Jul 28 2017 - 11:39:03 EST


On Fri, Jul 28, 2017 at 05:08:50PM +0200, Borislav Petkov wrote:
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 6dde0497efc7..9486a2ca6556 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -162,6 +162,9 @@ void mce_register_decode_chain(struct notifier_block *nb)
>
> atomic_inc(&num_notifiers);
>
> + if (nb->priority == MCE_PRIO_DECODER)
> + mca_cfg.has_decoder = true;
> +
> blocking_notifier_chain_register(&x86_mce_decoder_chain, nb);
> }
> EXPORT_SYMBOL_GPL(mce_register_decode_chain);

Forgot the counterpart:

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 9486a2ca6556..974e9c931e6f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -173,6 +173,9 @@ void mce_unregister_decode_chain(struct notifier_block *nb)
{
atomic_dec(&num_notifiers);

+ if (nb->priority == MCE_PRIO_DECODER)
+ mca_cfg.has_decoder = false;
+
blocking_notifier_chain_unregister(&x86_mce_decoder_chain, nb);
}
EXPORT_SYMBOL_GPL(mce_unregister_decode_chain);

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--