Skip to content

Commit

Permalink
x86/MCE/AMD: Allow thresholding interface updates after init
Browse files Browse the repository at this point in the history
Changes to the AMD Thresholding sysfs code prevents sysfs writes from
updating the underlying registers once CPU init is completed, i.e.
"threshold_banks" is set.

Allow the registers to be updated if the thresholding interface is
already initialized or if in the init path. Use the "set_lvt_off" value
to indicate if running in the init path, since this value is only set
during init.

Fixes: a037f3c ("x86/mce/amd: Make threshold bank setting hotplug robust")
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220117161328.19148-1-yazen.ghannam@amd.com
  • Loading branch information
Yazen Ghannam authored and Borislav Petkov committed Jan 23, 2022
1 parent e783362 commit 1f52b0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/mce/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static void threshold_restart_bank(void *_tr)
u32 hi, lo;

/* sysfs write might race against an offline operation */
if (this_cpu_read(threshold_banks))
if (!this_cpu_read(threshold_banks) && !tr->set_lvt_off)
return;

rdmsr(tr->b->address, lo, hi);
Expand Down

0 comments on commit 1f52b0a

Please sign in to comment.