[<prev] [next>] [day] [month] [year] [list]
Message-ID: <175758653133.709179.16801874345100038068.tip-bot2@tip-bot2>
Date: Thu, 11 Sep 2025 10:28:51 -0000
From: "tip-bot2 for Yazen Ghannam" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Yazen Ghannam <yazen.ghannam@....com>,
"Borislav Petkov (AMD)" <bp@...en8.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: ras/core] x86/mce/amd: Define threshold restart function for banks
The following commit has been merged into the ras/core branch of tip:
Commit-ID: 5a92e88ffc49c383472f4b686d1bbe89e7b33cf3
Gitweb: https://git.kernel.org/tip/5a92e88ffc49c383472f4b686d1bbe89e7b33cf3
Author: Yazen Ghannam <yazen.ghannam@....com>
AuthorDate: Mon, 08 Sep 2025 15:40:42
Committer: Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Thu, 11 Sep 2025 12:23:49 +02:00
x86/mce/amd: Define threshold restart function for banks
Prepare for CMCI storm support by moving the common bank/block iterator code
to a helper function.
Include a parameter to switch the interrupt enable. This will be used by
the CMCI storm handling function.
Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Link: https://lore.kernel.org/20250908-wip-mca-updates-v6-0-eef5d6c74b9c@amd.com
---
arch/x86/kernel/cpu/mce/amd.c | 37 +++++++++++++++++-----------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 9ca4079..fbdb0ce 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -471,6 +471,24 @@ static void threshold_restart_block(void *_tr)
wrmsr(tr->b->address, lo, hi);
}
+static void threshold_restart_bank(unsigned int bank, bool intr_en)
+{
+ struct threshold_bank **thr_banks = this_cpu_read(threshold_banks);
+ struct threshold_block *block, *tmp;
+ struct thresh_restart tr;
+
+ if (!thr_banks || !thr_banks[bank])
+ return;
+
+ memset(&tr, 0, sizeof(tr));
+
+ list_for_each_entry_safe(block, tmp, &thr_banks[bank]->miscj, miscj) {
+ tr.b = block;
+ tr.b->interrupt_enable = intr_en;
+ threshold_restart_block(&tr);
+ }
+}
+
static void mce_threshold_block_init(struct threshold_block *b, int offset)
{
struct thresh_restart tr = {
@@ -814,24 +832,7 @@ static void amd_deferred_error_interrupt(void)
static void amd_reset_thr_limit(unsigned int bank)
{
- struct threshold_bank **bp = this_cpu_read(threshold_banks);
- struct threshold_block *block, *tmp;
- struct thresh_restart tr;
-
- /*
- * Validate that the threshold bank has been initialized already. The
- * handler is installed at boot time, but on a hotplug event the
- * interrupt might fire before the data has been initialized.
- */
- if (!bp || !bp[bank])
- return;
-
- memset(&tr, 0, sizeof(tr));
-
- list_for_each_entry_safe(block, tmp, &bp[bank]->miscj, miscj) {
- tr.b = block;
- threshold_restart_block(&tr);
- }
+ threshold_restart_bank(bank, true);
}
/*
Powered by blists - more mailing lists