Skip to content

Commit 0d86c23

Browse files
committed
Merge tag 'ras_core_for_v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS update from Borislav Petkov: - A cleanup to the MCE notification machinery * tag 'ras_core_for_v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce/inject: Remove call to mce_notify_irq()
2 parents ae8371a + 6447828 commit 0d86c23

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

arch/x86/include/asm/mce.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ enum mcp_flags {
296296

297297
void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
298298

299-
bool mce_notify_irq(void);
300-
301299
DECLARE_PER_CPU(struct mce, injectm);
302300

303301
/* Disable CMCI/polling for MCA bank claimed by firmware */

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,28 @@ bool mce_is_correctable(struct mce *m)
584584
}
585585
EXPORT_SYMBOL_GPL(mce_is_correctable);
586586

587+
/*
588+
* Notify the user(s) about new machine check events.
589+
* Can be called from interrupt context, but not from machine check/NMI
590+
* context.
591+
*/
592+
static bool mce_notify_irq(void)
593+
{
594+
/* Not more than two messages every minute */
595+
static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
596+
597+
if (test_and_clear_bit(0, &mce_need_notify)) {
598+
mce_work_trigger();
599+
600+
if (__ratelimit(&ratelimit))
601+
pr_info(HW_ERR "Machine check events logged\n");
602+
603+
return true;
604+
}
605+
606+
return false;
607+
}
608+
587609
static int mce_early_notifier(struct notifier_block *nb, unsigned long val,
588610
void *data)
589611
{
@@ -1773,28 +1795,6 @@ static void mce_timer_delete_all(void)
17731795
del_timer_sync(&per_cpu(mce_timer, cpu));
17741796
}
17751797

1776-
/*
1777-
* Notify the user(s) about new machine check events.
1778-
* Can be called from interrupt context, but not from machine check/NMI
1779-
* context.
1780-
*/
1781-
bool mce_notify_irq(void)
1782-
{
1783-
/* Not more than two messages every minute */
1784-
static DEFINE_RATELIMIT_STATE(ratelimit, 60*HZ, 2);
1785-
1786-
if (test_and_clear_bit(0, &mce_need_notify)) {
1787-
mce_work_trigger();
1788-
1789-
if (__ratelimit(&ratelimit))
1790-
pr_info(HW_ERR "Machine check events logged\n");
1791-
1792-
return true;
1793-
}
1794-
return false;
1795-
}
1796-
EXPORT_SYMBOL_GPL(mce_notify_irq);
1797-
17981798
static void __mcheck_cpu_mce_banks_init(void)
17991799
{
18001800
struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ static int raise_local(void)
229229
} else if (m->status) {
230230
pr_info("Starting machine check poll CPU %d\n", cpu);
231231
raise_poll(m);
232-
mce_notify_irq();
233232
pr_info("Machine check poll done on CPU %d\n", cpu);
234233
} else
235234
m->finished = 0;

0 commit comments

Comments
 (0)