x86/mce/amd: Cleanup threshold device remove path
authorThomas Gleixner <tglx@linutronix.de>
Tue, 31 Mar 2020 08:53:18 +0000 (10:53 +0200)
committerBorislav Petkov <bp@suse.de>
Tue, 14 Apr 2020 13:49:51 +0000 (15:49 +0200)
commitf26d2580a7ddc84aa9e51e47fdbb5ad63dbee5a7
tree065febd8e563bc04e78e5a00e9b2fdf24ce2ffdb
parent6458de97fc15530b54477c4e2b70af653e8ac3d9
x86/mce/amd: Cleanup threshold device remove path

Pass in the bank pointer directly to the cleaning up functions,
obviating the need for per-CPU accesses. Make the clean up path
interrupt-safe by cleaning the bank pointer first so that the rest of
the teardown happens safe from the thresholding interrupt.

No functional changes.

 [ bp: Write commit message and reverse bank->shared test to save an
   indentation level in threshold_remove_bank(). ]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200403161943.1458-7-bp@alien8.de
arch/x86/include/asm/amd_nb.h
arch/x86/kernel/cpu/mce/amd.c