Skip to content

Commit c9c6d21

Browse files
aeglsuryasaimadhu
authored andcommitted
x86/mce: Rename "first" function as "early"
It isn't going to be first on the notifier chain when the CEC is moved to be a normal user of the notifier chain. Fix the enum for the MCE_PRIO symbols to list them in reverse order so that the compiler can give them numbers from low to high priority. Add an entry for MCE_PRIO_CEC as the highest priority. [ bp: Use passive voice, add comments. ] Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 3e0fdec commit c9c6d21

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

arch/x86/include/asm/mce.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,16 @@ struct mce_log_buffer {
144144
struct mce entry[];
145145
};
146146

147+
/* Highest last */
147148
enum mce_notifier_prios {
148-
MCE_PRIO_FIRST = INT_MAX,
149-
MCE_PRIO_UC = INT_MAX - 1,
150-
MCE_PRIO_EXTLOG = INT_MAX - 2,
151-
MCE_PRIO_NFIT = INT_MAX - 3,
152-
MCE_PRIO_EDAC = INT_MAX - 4,
153-
MCE_PRIO_MCELOG = 1,
154-
MCE_PRIO_LOWEST = 0,
149+
MCE_PRIO_LOWEST,
150+
MCE_PRIO_MCELOG,
151+
MCE_PRIO_EDAC,
152+
MCE_PRIO_NFIT,
153+
MCE_PRIO_EXTLOG,
154+
MCE_PRIO_UC,
155+
MCE_PRIO_EARLY,
156+
MCE_PRIO_CEC
155157
};
156158

157159
struct notifier_block;

arch/x86/kernel/cpu/mce/core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ static bool cec_add_mce(struct mce *m)
559559
return false;
560560
}
561561

562-
static int mce_first_notifier(struct notifier_block *nb, unsigned long val,
562+
static int mce_early_notifier(struct notifier_block *nb, unsigned long val,
563563
void *data)
564564
{
565565
struct mce *m = (struct mce *)data;
@@ -580,9 +580,9 @@ static int mce_first_notifier(struct notifier_block *nb, unsigned long val,
580580
return NOTIFY_DONE;
581581
}
582582

583-
static struct notifier_block first_nb = {
584-
.notifier_call = mce_first_notifier,
585-
.priority = MCE_PRIO_FIRST,
583+
static struct notifier_block early_nb = {
584+
.notifier_call = mce_early_notifier,
585+
.priority = MCE_PRIO_EARLY,
586586
};
587587

588588
static int uc_decode_notifier(struct notifier_block *nb, unsigned long val,
@@ -2041,7 +2041,7 @@ __setup("mce", mcheck_enable);
20412041
int __init mcheck_init(void)
20422042
{
20432043
mcheck_intel_therm_init();
2044-
mce_register_decode_chain(&first_nb);
2044+
mce_register_decode_chain(&early_nb);
20452045
mce_register_decode_chain(&mce_uc_nb);
20462046
mce_register_decode_chain(&mce_default_nb);
20472047
mcheck_vendor_init_severity();

0 commit comments

Comments
 (0)