Linux EDAC development
 help / color / mirror / Atom feed
From: Jasjeet Rangi <jrangi@purestorage.com>
To: x86@kernel.org
Cc: jrangi@purestorage.com, tony.luck@intel.com, bp@alien8.de,
	tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	hpa@zytor.com, linux-edac@vger.kernel.org,
	stable@vger.kernel.org, Smita.KoralahalliChannabasappa@amd.com,
	yazen.ghannam@amd.com, msaggi@purestorage.com,
	rjethwani@purestorage.com, rhan@purestorage.com,
	dgiani@purestorage.com
Subject: [PATCH v2 1/2] x86/mce/amd: Fix inverted interrupt enablement during storm handling
Date: Wed, 12 Aug 2026 16:15:13 -0600	[thread overview]
Message-ID: <20260812221514.598842-2-jrangi@purestorage.com> (raw)
In-Reply-To: <20260812221514.598842-1-jrangi@purestorage.com>

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: stable@vger.kernel.org
Signed-off-by: Jasjeet Rangi <jrangi@purestorage.com>
---
 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


  reply	other threads:[~2026-08-12 22:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 22:15 [PATCH v2 0/2] x86/mce/amd: Fix inverted interrupt enablement during storm handling Jasjeet Rangi
2026-08-12 22:15 ` Jasjeet Rangi [this message]
2026-08-14 23:24   ` [PATCH v2 1/2] " Borislav Petkov
2026-08-17 18:51     ` Jasjeet Rangi
2026-08-18 19:02       ` Borislav Petkov
2026-08-19  6:46         ` Jasjeet Rangi
2026-08-19 14:06           ` Yazen Ghannam
2026-08-19 17:59             ` Jasjeet Rangi
2026-08-12 22:15 ` [PATCH v2 2/2] x86/mce: Rename MCE storm handler parameters for storm mode Jasjeet Rangi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812221514.598842-2-jrangi@purestorage.com \
    --to=jrangi@purestorage.com \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dgiani@purestorage.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=msaggi@purestorage.com \
    --cc=rhan@purestorage.com \
    --cc=rjethwani@purestorage.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox