[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251222094351.38792-13-tianruidong@linux.alibaba.com>
Date: Mon, 22 Dec 2025 17:43:45 +0800
From: Ruidong Tian <tianruidong@...ux.alibaba.com>
To: catalin.marinas@....com,
will@...nel.org,
lpieralisi@...nel.org,
guohanjun@...wei.com,
sudeep.holla@....com,
xueshuai@...ux.alibaba.com,
linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
rafael@...nel.org,
lenb@...nel.org,
tony.luck@...el.com,
bp@...en8.de,
yazen.ghannam@....com,
misono.tomohiro@...itsu.com
Cc: tianruidong@...ux.alibaba.com
Subject: [PATCH v4 12/17] ras: AEST: Allow configuring CE threshold via debugfs
This commit introduces the ability to configure the Corrected Error (CE)
threshold for AEST records through debugfs. This allows administrators to
dynamically adjust the CE threshold for error reporting.
Signed-off-by: Ruidong Tian <tianruidong@...ux.alibaba.com>
---
Documentation/ABI/testing/debugfs-aest | 16 ++++++++++
drivers/ras/aest/aest-sysfs.c | 42 ++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
diff --git a/Documentation/ABI/testing/debugfs-aest b/Documentation/ABI/testing/debugfs-aest
index a984fcedede2..76ba1b77b274 100644
--- a/Documentation/ABI/testing/debugfs-aest
+++ b/Documentation/ABI/testing/debugfs-aest
@@ -23,6 +23,14 @@ Description:
See more at:
https://developer.arm.com/documentation/den0085/latest/
+What: /sys/kernel/debug/aest/<name>.<id>/<node_name>/ce_threshold
+Date: Dec 2025
+KernelVersion 6.19
+Contact: Ruidong Tian <tianruidong@...ux.alibaba.com>
+Description:
+ (WO) Write the ce threshold to all records of this node. Failed
+ if input exceeded the maximum threshold
+
What: /sys/kernel/debug/aest/<name>.<id>/<node_name>/err_count
Date: Dec 2025
KernelVersion 6.19
@@ -37,6 +45,14 @@ Contact: Ruidong Tian <tianruidong@...ux.alibaba.com>
Description:
(RO) Read err_* register and return val.
+What: /sys/kernel/debug/aest/<name>.<id>/<node_name>/record<index>/ce_threshold
+Date: Dec 2025
+KernelVersion 6.19
+Contact: Ruidong Tian <tianruidong@...ux.alibaba.com>
+Description:
+ (RW) Read and write the ce threshold to this record. Failed
+ if input exceeded the maximum threshold
+
What: /sys/kernel/debug/aest/<name>.<id>/<node_name>/record<index>/err_count
Date: Dec 2025
KernelVersion 6.19
diff --git a/drivers/ras/aest/aest-sysfs.c b/drivers/ras/aest/aest-sysfs.c
index b54e879506aa..392e7ad8328e 100644
--- a/drivers/ras/aest/aest-sysfs.c
+++ b/drivers/ras/aest/aest-sysfs.c
@@ -7,6 +7,25 @@
#include "aest.h"
+static void
+aest_store_threshold(struct aest_record *record, void *data)
+{
+ u64 err_misc0, *threshold = data;
+ struct ce_threshold *ce = &record->ce;
+
+ if (*threshold > ce->info->max_count)
+ return;
+
+ ce->threshold = *threshold;
+ ce->count = ce->info->max_count - ce->threshold + 1;
+
+ err_misc0 = record_read(record, ERXMISC0);
+ ce->reg_val = (err_misc0 & ~ce->info->mask) |
+ (ce->count << ce->info->shift);
+
+ record_write(record, ERXMISC0, ce->reg_val);
+}
+
static void
aest_error_count(struct aest_record *record, void *data)
{
@@ -77,6 +96,27 @@ DEFINE_AEST_DEBUGFS_ATTR(err_misc1, ERXMISC1);
DEFINE_AEST_DEBUGFS_ATTR(err_misc2, ERXMISC2);
DEFINE_AEST_DEBUGFS_ATTR(err_misc3, ERXMISC3);
+static int record_ce_threshold_get(void *data, u64 *val)
+{
+ struct aest_record *record = data;
+
+ *val = record->ce.threshold;
+ return 0;
+}
+
+static int record_ce_threshold_set(void *data, u64 val)
+{
+ u64 threshold = val;
+ struct aest_record *record = data;
+
+ aest_store_threshold(record, &threshold);
+
+ return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(record_ce_threshold_ops, record_ce_threshold_get,
+ record_ce_threshold_set, "%llu\n");
+
static int aest_record_err_count_show(struct seq_file *m, void *data)
{
struct aest_record *record = m->private;
@@ -116,6 +156,8 @@ static void aest_record_init_debugfs(struct aest_record *record)
&err_misc3_ops);
debugfs_create_file("err_count", 0400, record->debugfs, record,
&aest_record_err_count_fops);
+ debugfs_create_file("ce_threshold", 0600, record->debugfs, record,
+ &record_ce_threshold_ops);
}
static void
--
2.51.2.612.gdc70283dfc
Powered by blists - more mailing lists