Re: [PATCH v2 1/2] x86/mce/amd: Fix inverted interrupt enablement during storm handling

Borislav Petkov <[email protected]>
Newsgroups org.kernel.vger.linux-edac,org.kernel.vger.stable
Message-ID <20260814232446.GDan-jvtKrj4Bh8Nsa@fat_crate.local>
On Wed, Aug 12, 2026 at 04:15:13PM -0600, Jasjeet Rangi wrote:
> 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.

Except that the Intel side doesn't touch the CMCI_EN bit in
cmci_set_threshold(). And we should not diverge here. The thresholding
interrupt should not be a problem because with increased polling frequency
during a storm, we should not be really getting thresholding interrupts
because the polling code will pick up all MCEs that get logged, first.

And the second patch is not really making things better because, well, "on" is
"in_storm_mode". Basically the same thing. So I'm going to queue the below:

---
Author: Jasjeet Rangi <[email protected]>
Date:   Wed Aug 12 16:15:13 2026 -0600

    x86/MCE/AMD: Fix inverted interrupt enablement during storm handling
    
    mce_amd_handle_storm() currently does the opposite of what storm
    handling needs: it enables thresholding interrupts when a storm is
    detected and disables them when the storm subsides.
    
    Flip the "on" function argument before passing it to threshold_restart_bank()
    as it should have been done.
    
    To clarify: "on" to mce_handle_storm() means, the storm is on now when
    "on" is true, and off when "on" is false.
    
      [ bp: Simplify. ]
    
    Fixes: 5c4663ed1eac ("x86/mce: Handle AMD threshold interrupt storms")
    Signed-off-by: Jasjeet Rangi <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index f916fb4c5d13..1cc20b855b7e 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -865,7 +865,7 @@ 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)

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.