All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/mce: Schedule work after restart from sysfs update
@ 2023-03-01 22:14 Yazen Ghannam
  2023-03-01 22:16 ` Luck, Tony
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yazen Ghannam @ 2023-03-01 22:14 UTC (permalink / raw)
  To: linux-edac; +Cc: linux-kernel, tony.luck, x86, Yazen Ghannam

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_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_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>
---
Link:
https://lore.kernel.org/r/20230301202623.2092271-1-yazen.ghannam@amd.com

v1->v2:
* Refer to correct function in commit message.

 arch/x86/kernel/cpu/mce/core.c | 1 +
 1 file changed, 1 insertion(+)

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 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] x86/mce: Schedule work after restart from sysfs update
  2023-03-01 22:14 [PATCH v2] x86/mce: Schedule work after restart from sysfs update Yazen Ghannam
@ 2023-03-01 22:16 ` Luck, Tony
  2023-03-01 22:18 ` Slade Watkins
  2023-03-12 20:38 ` [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after " tip-bot2 for Yazen Ghannam
  2 siblings, 0 replies; 5+ messages in thread
From: Luck, Tony @ 2023-03-01 22:16 UTC (permalink / raw)
  To: Yazen Ghannam, linux-edac; +Cc: linux-kernel, x86

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

Reviewed-by: Tony Luck <tony.luck@intel.com>

-Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] x86/mce: Schedule work after restart from sysfs update
  2023-03-01 22:14 [PATCH v2] x86/mce: Schedule work after restart from sysfs update Yazen Ghannam
  2023-03-01 22:16 ` Luck, Tony
@ 2023-03-01 22:18 ` Slade Watkins
  2023-03-12 20:38 ` [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after " tip-bot2 for Yazen Ghannam
  2 siblings, 0 replies; 5+ messages in thread
From: Slade Watkins @ 2023-03-01 22:18 UTC (permalink / raw)
  To: Yazen Ghannam; +Cc: linux-edac, linux-kernel, tony.luck, x86

On 3/1/23 17:14, Yazen Ghannam wrote:
> 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_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_restart() so that queued
> errors are processed.
> 
> Fixes: 3bff147b187d ("x86/mce: Defer processing of early errors")
> Cc: stable@vger.kernel.org

Yazen,
Despite Cc: stable@vger.kernel.org being here, the list wasn't Cc'd on this
email. Figured I'd let you know in case you create a v3 or resend at any point :).

Cheers,
-- Slade

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after sysfs update
  2023-03-01 22:14 [PATCH v2] x86/mce: Schedule work after restart from sysfs update Yazen Ghannam
  2023-03-01 22:16 ` Luck, Tony
  2023-03-01 22:18 ` Slade Watkins
@ 2023-03-12 20:38 ` tip-bot2 for Yazen Ghannam
  2023-03-14 14:40   ` Yazen Ghannam
  2 siblings, 1 reply; 5+ messages in thread
From: tip-bot2 for Yazen Ghannam @ 2023-03-12 20:38 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Yazen Ghannam, Borislav Petkov (AMD),
	Tony Luck, stable, x86, linux-kernel

The following commit has been merged into the ras/urgent branch of tip:

Commit-ID:     4783b9cb374af02d49740e00e2da19fd4ed6dec4
Gitweb:        https://git.kernel.org/tip/4783b9cb374af02d49740e00e2da19fd4ed6dec4
Author:        Yazen Ghannam <yazen.ghannam@amd.com>
AuthorDate:    Wed, 01 Mar 2023 22:14:20 
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sun, 12 Mar 2023 21:12:21 +01:00

x86/mce: Make sure logged MCEs are processed after sysfs update

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_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_restart() so that queued
errors are processed.

Fixes: 3bff147b187d ("x86/mce: Defer processing of early errors")
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230301221420.2203184-1-yazen.ghannam@amd.com
---
 arch/x86/kernel/cpu/mce/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 7832a69..2eec60f 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 */

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after sysfs update
  2023-03-12 20:38 ` [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after " tip-bot2 for Yazen Ghannam
@ 2023-03-14 14:40   ` Yazen Ghannam
  0 siblings, 0 replies; 5+ messages in thread
From: Yazen Ghannam @ 2023-03-14 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-tip-commits, Borislav Petkov (AMD), Tony Luck, stable, x86

On Sun, Mar 12, 2023 at 08:38:33PM -0000, tip-bot2 for Yazen Ghannam wrote:
> The following commit has been merged into the ras/urgent branch of tip:
> 
> Commit-ID:     4783b9cb374af02d49740e00e2da19fd4ed6dec4
> Gitweb:        https://git.kernel.org/tip/4783b9cb374af02d49740e00e2da19fd4ed6dec4
> Author:        Yazen Ghannam <yazen.ghannam@amd.com>
> AuthorDate:    Wed, 01 Mar 2023 22:14:20 
> Committer:     Borislav Petkov (AMD) <bp@alien8.de>
> CommitterDate: Sun, 12 Mar 2023 21:12:21 +01:00
> 
> x86/mce: Make sure logged MCEs are processed after sysfs update
> 
> 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_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_restart() so that queued
> errors are processed.
> 
> Fixes: 3bff147b187d ("x86/mce: Defer processing of early errors")
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> Reviewed-by: Tony Luck <tony.luck@intel.com>

Thank you!

-Yazen

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-14 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 22:14 [PATCH v2] x86/mce: Schedule work after restart from sysfs update Yazen Ghannam
2023-03-01 22:16 ` Luck, Tony
2023-03-01 22:18 ` Slade Watkins
2023-03-12 20:38 ` [tip: ras/urgent] x86/mce: Make sure logged MCEs are processed after " tip-bot2 for Yazen Ghannam
2023-03-14 14:40   ` Yazen Ghannam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.