From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933386AbcKGSTZ (ORCPT ); Mon, 7 Nov 2016 13:19:25 -0500 Received: from mail.skyhub.de ([78.46.96.112]:34761 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933343AbcKGSTJ (ORCPT ); Mon, 7 Nov 2016 13:19:09 -0500 Date: Mon, 7 Nov 2016 19:19:06 +0100 From: Borislav Petkov To: Thomas Gleixner Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, rt@linutronix.de, Tony Luck , linux-edac@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 21/25] x86/mcheck: Split threshold_cpu_callback into two callbacks Message-ID: <20161107181906.n72wt4zxufqmvrdu@pd.tnic> References: <20161103145021.28528-1-bigeasy@linutronix.de> <20161103145021.28528-22-bigeasy@linutronix.de> <20161107132040.w6oaoe2hu6hpdvy4@pd.tnic> <20161107132500.ptxf6b4ql56pketo@linutronix.de> <20161107150745.atoljrm4ppxw6ed6@pd.tnic> <20161107172617.vaflu3wdfdygunsi@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161107172617.vaflu3wdfdygunsi@linutronix.de> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 07, 2016 at 06:26:17PM +0100, Sebastian Andrzej Siewior wrote: > Subject: x86/mcheck: Split threshold_cpu_callback into two callbacks > From: Sebastian Andrzej Siewior > Date: Tue, 25 Oct 2016 18:04:25 +0200 > > The threshold_cpu_callback callbacks looks like one of the notifier and > its arguments are almost the same. Split this out and have one ONLINE > and one DEAD callback. This will come handy later once the main code > gets changed to use the callback mechanism. > Also, handle threshold_cpu_callback_online() return value so we don't > continue if the function fails. > > Boris Petkov removed the callback pointer and replaced it with proper > functions. > > Cc: Tony Luck > Cc: Borislav Petkov > Cc: linux-edac@vger.kernel.org > Cc: x86@kernel.org > Signed-off-by: Sebastian Andrzej Siewior > Signed-off-by: Thomas Gleixner > --- a/arch/x86/include/asm/mce.h > +++ b/arch/x86/include/asm/mce.h > @@ -293,9 +293,7 @@ void do_machine_check(struct pt_regs *, > /* > * Threshold handler > */ > - > extern void (*mce_threshold_vector)(void); > -extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); > > /* Deferred error interrupt handler */ > extern void (*deferred_error_int_vector)(void); > @@ -377,7 +375,12 @@ struct smca_bank_info { > }; > > extern struct smca_bank_info smca_banks[MAX_NR_BANKS]; > +extern int mce_threshold_create_device(unsigned int cpu); > +extern int mce_threshold_remove_device(unsigned int cpu); > +#else > > +static inline int mce_threshold_create_device(unsigned int cpu) { return 0; }; > +static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; }; > #endif > > #endif /* _ASM_X86_MCE_H */ Right, just a heads-up for tip guys: this second hunk will cause a merge conflict with the other RAS changes: Applying patch 21-x86-mcheck-split_threshold_cpu_callback_into_two_callbacks.patch patching file arch/x86/include/asm/mce.h Hunk #1 succeeded at 292 (offset -1 lines). Hunk #2 FAILED at 375. 1 out of 2 hunks FAILED -- saving rejects to file arch/x86/include/asm/mce.h.rej The fixup is easy though as it is only a contextual conflict due to renaming of smca_bank_info to smca_bank: Index: b/arch/x86/include/asm/mce.h =================================================================== --- a/arch/x86/include/asm/mce.h 2016-11-07 19:12:14.309920731 +0100 +++ b/arch/x86/include/asm/mce.h 2016-11-07 19:13:47.521922219 +0100 @@ -292,9 +292,7 @@ void do_machine_check(struct pt_regs *, /* * Threshold handler */ - extern void (*mce_threshold_vector)(void); -extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); /* Deferred error interrupt handler */ extern void (*deferred_error_int_vector)(void); @@ -372,6 +370,11 @@ struct smca_bank { extern struct smca_bank smca_banks[MAX_NR_BANKS]; extern const char *smca_get_long_name(enum smca_bank_types t); +extern int mce_threshold_create_device(unsigned int cpu); +extern int mce_threshold_remove_device(unsigned int cpu); +#else +static inline int mce_threshold_create_device(unsigned int cpu) { return 0; }; +static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; }; #endif #endif /* _ASM_X86_MCE_H */ --- Thanks! -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.