summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYazen Ghannam <yazen.ghannam@amd.com>2022-01-17 16:13:28 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-01 17:25:42 +0100
commit08f090bb9b6951a510437ef26ad78ffb3ee17142 (patch)
treecc4077fa4f27e33b3224039e1c76d8dd3b366139 /arch
parent791e5d5daa2c8d66d1c5ad9cacdf554a92c65cbc (diff)
downloadlinux-stable-08f090bb9b6951a510437ef26ad78ffb3ee17142.tar.gz
linux-stable-08f090bb9b6951a510437ef26ad78ffb3ee17142.tar.bz2
linux-stable-08f090bb9b6951a510437ef26ad78ffb3ee17142.zip
x86/MCE/AMD: Allow thresholding interface updates after init
commit 1f52b0aba6fd37653416375cb8a1ca673acf8d5f upstream. 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: a037f3ca0ea0 ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/mce/amd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 0c6b02dd744c..f73f1184b1c1 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -387,7 +387,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);