From nobody Mon Feb 9 11:28:41 2026 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17B283126C1; Mon, 22 Dec 2025 09:44:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.113 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766396678; cv=none; b=okydaJ6xhzw//EvvoCUZOTKC/1ptQwcbK7HYhLIpcJhn3ZKFr1oNGBOuc/A5yqoyEhzrI9qx0mkKRhhsi1pAT2VPAotcyp0qK228GG+OnYZczrMuluDQUvezVbY19mvCDopQzT1CNrr1n30aWII7Dknutzu13/qJrkk0CvrNERQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766396678; c=relaxed/simple; bh=RoBhdZh2mMQ2EdPvodoFkQFkBo5ObbvfC8qDfvU9TOM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UHfVmp2pHdoR82INAz2eRq+p/NajMc6Qsjez5aw6k7ppSv1gZio9OInz+MinFDdd85Xr3uW0ws+qOYdeeVQFC0aHS4Nu+UmV0IrsaCM8+mJ2pmBBvUL41U2YMhoXT9Xssncr2JDPw4NIyfHlKxEHQjENzRP0Dx48KOqsqRO3cQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=rMF2aAbi; arc=none smtp.client-ip=115.124.30.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="rMF2aAbi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1766396673; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=DnOhC3gDzjPKL1u8Gf/D8zWgsYNDRy9TN8Idu01s0JM=; b=rMF2aAbibPp3HYvGlbGj+pKiAZyi4vBsuH3sC4gdekfGbhGTfDiyA8U3fqmylOSGolkLEazsMuqL10uMhvKj0qwLWxxJFSwXo0Z7IMMY0hpTGqZjbQmSc08AvlS4D4cvyDkyARf/snQ91VmsdSN8Jl3A+KVPw3EiS7zMZfkfO4Q= Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0WvOT.WZ_1766396671 cluster:ay36) by smtp.aliyun-inc.com; Mon, 22 Dec 2025 17:44:33 +0800 From: Ruidong Tian To: catalin.marinas@arm.com, will@kernel.org, lpieralisi@kernel.org, guohanjun@huawei.com, sudeep.holla@arm.com, xueshuai@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rafael@kernel.org, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, yazen.ghannam@amd.com, misono.tomohiro@fujitsu.com Cc: tianruidong@linux.alibaba.com Subject: [PATCH v4 12/17] ras: AEST: Allow configuring CE threshold via debugfs Date: Mon, 22 Dec 2025 17:43:45 +0800 Message-Id: <20251222094351.38792-13-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20251222094351.38792-1-tianruidong@linux.alibaba.com> References: <20251222094351.38792-1-tianruidong@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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/tes= ting/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/ =20 +What: /sys/kernel/debug/aest/.//ce_threshold +Date: Dec 2025 +KernelVersion 6.19 +Contact: Ruidong Tian +Description: + (WO) Write the ce threshold to all records of this node. Failed + if input exceeded the maximum threshold + What: /sys/kernel/debug/aest/.//err_count Date: Dec 2025 KernelVersion 6.19 @@ -37,6 +45,14 @@ Contact: Ruidong Tian Description: (RO) Read err_* register and return val. =20 +What: /sys/kernel/debug/aest/.//record/ce_thr= eshold +Date: Dec 2025 +KernelVersion 6.19 +Contact: Ruidong Tian +Description: + (RW) Read and write the ce threshold to this record. Failed + if input exceeded the maximum threshold + What: /sys/kernel/debug/aest/.//record/err_co= unt 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 @@ =20 #include "aest.h" =20 +static void +aest_store_threshold(struct aest_record *record, void *data) +{ + u64 err_misc0, *threshold =3D data; + struct ce_threshold *ce =3D &record->ce; + + if (*threshold > ce->info->max_count) + return; + + ce->threshold =3D *threshold; + ce->count =3D ce->info->max_count - ce->threshold + 1; + + err_misc0 =3D record_read(record, ERXMISC0); + ce->reg_val =3D (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); =20 +static int record_ce_threshold_get(void *data, u64 *val) +{ + struct aest_record *record =3D data; + + *val =3D record->ce.threshold; + return 0; +} + +static int record_ce_threshold_set(void *data, u64 val) +{ + u64 threshold =3D val; + struct aest_record *record =3D 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 =3D 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); } =20 static void --=20 2.51.2.612.gdc70283dfc