[PATCH v2 1/2] x86/mce/amd: Fix inverted interrupt enablement during storm handling
Jasjeet Rangi <[email protected]>
| Newsgroups | org.kernel.vger.stable,org.kernel.vger.linux-edac |
|---|---|
| Message-ID | <[email protected]> |
mce_amd_handle_storm() currently does the opposite of what storm
handling needs: it enables threshold interrupts when a storm is detected
and disables them when the storm subsides.
In addition, machine_check_poll() -> clear_bank() -> amd_clear_bank() ->
amd_reset_thr_limit() will unconditionally enable threshold interrupts,
which undoes storm mode behavior.
Fix this by disabling interrupts when storm mode is entered and enabling
interrupts when storm mode is cleared. Also make amd_reset_thr_limit()
enable interrupts when the bank is not in storm mode and disable
interrupts when the bank is in storm mode.
Fixes: 5c4663ed1eac ("x86/mce: Handle AMD threshold interrupt storms")
Cc: [email protected]
Signed-off-by: Jasjeet Rangi <[email protected]>
---
arch/x86/kernel/cpu/mce/amd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 36e0df4d1342..04accdee6aab 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -864,12 +864,15 @@ static void amd_deferred_error_interrupt(void)
void mce_amd_handle_storm(unsigned int bank, bool on)
{
- threshold_restart_bank(bank, on);
+ threshold_restart_bank(bank, !on);
}
static void amd_reset_thr_limit(unsigned int bank)
{
- threshold_restart_bank(bank, true);
+ struct mca_storm_desc *storm = this_cpu_ptr(&storm_desc);
+ bool intr_en = !storm->banks[bank].in_storm_mode;
+
+ threshold_restart_bank(bank, intr_en);
}
/*
--
2.50.1