x86/mce: Schedule work after restart from sysfs update

Message ID 20230301202623.2092271-1-yazen.ghannam@amd.com
State New
Headers
Series x86/mce: Schedule work after restart from sysfs update |

Commit Message

Yazen Ghannam March 1, 2023, 8:26 p.m. UTC
  A recent change introduced a flag to queue up errors found during
boot-time polling. These errors will be processed during late init once
the MCE subsystem is fully set up.

A number of sysfs updates call mce_cpu_restart() which goes through a
subset of the CPU init flow. This includes polling MCA banks and logging
any errors found. Since the same function is used as boot-time polling,
errors will be queued. However, the system is now past late init, so the
errors will remain queued until another error is found and the workqueue
is triggered.

Call mce_schedule_work() at the end of mce_cpu_restart() so that queued
errors are processed.

Fixes: 3bff147b187d ("x86/mce: Defer processing of early errors")
Cc: stable@vger.kernel.org
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
 arch/x86/kernel/cpu/mce/core.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Luck, Tony March 1, 2023, 8:56 p.m. UTC | #1
> A number of sysfs updates call mce_cpu_restart() which goes through a

I think that should say "call mce_restart()"

-Tony
  
Yazen Ghannam March 1, 2023, 10:08 p.m. UTC | #2
On Wed, Mar 01, 2023 at 08:56:32PM +0000, Luck, Tony wrote:
> > A number of sysfs updates call mce_cpu_restart() which goes through a
> 
> I think that should say "call mce_restart()"
>

Yes, that's right. Thanks!

-Yazen
  

Patch

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 7832a69d170e..2eec60f50057 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2355,6 +2355,7 @@  static void mce_restart(void)
 {
 	mce_timer_delete_all();
 	on_each_cpu(mce_cpu_restart, NULL, 1);
+	mce_schedule_work();
 }
 
 /* Toggle features for corrected errors */