x86/MCE/AMD: Allow thresholding interface updates after init
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 17 Jan 2022 16:13:28 +0000 (16:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:27:05 +0000 (17:27 +0100)
commit98ccfec9eae6ac4175779a2e44899529b6a4d7e3
tree0055a7285cb25a1607922ebb554e08c398b2f7e6
parent74e88eceb0afeec4d000d0d63df27b1363fd0a77
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>
arch/x86/kernel/cpu/mce/amd.c