From nobody Mon Feb 9 17:22:25 2026 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) (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 066AB30DD36; Mon, 22 Dec 2025 09:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766396677; cv=none; b=bGH/dzhNV86LptlV8mhOk0yYu5u9NOV0c4ykf2USdj6AHMrU0bp2wyxImA/LVK0mxguN2oSRxvHYUmuhu9tNAeLHMPrZ4u9wf46/O/k8uhSVSD2zZPiXdI8XZWgCV14DkJVIkcy8b/bmU+3n2FDth5Bc3XP1vMw8QcUfezLWbQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766396677; c=relaxed/simple; bh=/j4Kqhzw+eN/aroO4vc2Dn6e+pTWroPHTzQ/7rhp40c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uHURBZ+mD+gl3tRBchF1UgHGOPylISzoK0adzZDoRpo/cPADyQCadkoq80awwNiTdQN0ZPaDerhlyFtj6FnqlaYeINcLG9UIxWs7tXYjOTb+lrR7ecCgPKbz5/oCACMLL5Q9W0jo42tUc7IszOHwW8MRF64u436n88P+hycFRcs= 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=WTFGV932; arc=none smtp.client-ip=115.124.30.131 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="WTFGV932" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1766396671; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=/oEXVsmFVs0xqk4gMISYSdlIJXvCPibEK0lRcifwNT0=; b=WTFGV932ihKQfJ0f+L67QeoLmnyxeYdwc9g/T5g2oSwtZLWD/LMyJNkEq4KECZ5pXmav6fhYtA9ryIAh2/q5k+KZxHPO5SiwkrhIIJXlcxsBfvhC50sjukybIEp2h1XvAbJRr+MdXfi74EWzFONsDLC1ETq4hvQFqYzmNq3aess= Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0WvOk-hQ_1766396669 cluster:ay36) by smtp.aliyun-inc.com; Mon, 22 Dec 2025 17:44:30 +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 11/17] ras: AEST: Add error count tracking and debugfs interface Date: Mon, 22 Dec 2025 17:43:44 +0800 Message-Id: <20251222094351.38792-12-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 error counting functionality for AEST records. Previously, error statistics were not directly available for individual error records or AEST nodes. Signed-off-by: Ruidong Tian --- Documentation/ABI/testing/debugfs-aest | 14 ++++++ drivers/ras/aest/aest-core.c | 21 +++++++++ drivers/ras/aest/aest-sysfs.c | 64 ++++++++++++++++++++++++++ drivers/ras/aest/aest.h | 10 ++++ 4 files changed, 109 insertions(+) diff --git a/Documentation/ABI/testing/debugfs-aest b/Documentation/ABI/tes= ting/debugfs-aest index 1152fc83c3fc..a984fcedede2 100644 --- a/Documentation/ABI/testing/debugfs-aest +++ b/Documentation/ABI/testing/debugfs-aest @@ -23,9 +23,23 @@ Description: See more at: https://developer.arm.com/documentation/den0085/latest/ =20 +What: /sys/kernel/debug/aest/.//err_count +Date: Dec 2025 +KernelVersion 6.19 +Contact: Ruidong Tian +Description: + (RO) Outputs error statistics for all error records of this node. + What: /sys/kernel/debug/aest/.//record/err_* Date: Dec 2025 KernelVersion 6.19 Contact: Ruidong Tian Description: (RO) Read err_* register and return val. + +What: /sys/kernel/debug/aest/.//record/err_co= unt +Date: Dec 2025 +KernelVersion 6.19 +Contact: Ruidong Tian +Description: + (RO) Outputs error statistics for all this records. diff --git a/drivers/ras/aest/aest-core.c b/drivers/ras/aest/aest-core.c index 3bcc635cf8e4..75cca98024ad 100644 --- a/drivers/ras/aest/aest-core.c +++ b/drivers/ras/aest/aest-core.c @@ -170,6 +170,27 @@ static int aest_node_gen_pool_add(struct aest_device *= adev, init_aest_event(event, record, regs); llist_add(&event->llnode, &adev->event_list); =20 + if (regs->err_status & ERR_STATUS_CE) + record->count.ce++; + if (regs->err_status & ERR_STATUS_DE) + record->count.de++; + if (regs->err_status & ERR_STATUS_UE) { + switch (regs->err_status & ERR_STATUS_UET) { + case ERR_STATUS_UET_UC: + record->count.uc++; + break; + case ERR_STATUS_UET_UEU: + record->count.ueu++; + break; + case ERR_STATUS_UET_UER: + record->count.uer++; + break; + case ERR_STATUS_UET_UEO: + record->count.ueo++; + break; + } + } + return 0; } =20 diff --git a/drivers/ras/aest/aest-sysfs.c b/drivers/ras/aest/aest-sysfs.c index f3b5427ff4f0..b54e879506aa 100644 --- a/drivers/ras/aest/aest-sysfs.c +++ b/drivers/ras/aest/aest-sysfs.c @@ -7,6 +7,46 @@ =20 #include "aest.h" =20 +static void +aest_error_count(struct aest_record *record, void *data) +{ + struct record_count *count =3D data; + + count->ce +=3D record->count.ce; + count->de +=3D record->count.de; + count->uc +=3D record->count.uc; + count->ueu +=3D record->count.ueu; + count->uer +=3D record->count.uer; + count->ueo +=3D record->count.ueo; +} + +/*************************************************************************= ****** + * + * Debugfs for AEST node + * + *************************************************************************= *****/ + +static int aest_node_err_count_show(struct seq_file *m, void *data) +{ + struct aest_node *node =3D m->private; + struct record_count count =3D { 0 }; + int i; + + for (i =3D 0; i < node->record_count; i++) + aest_error_count(&node->records[i], &count); + + seq_printf(m, "CE: %llu\n" + "DE: %llu\n" + "UC: %llu\n" + "UEU: %llu\n" + "UEO: %llu\n" + "UER: %llu\n", + count.ce, count.de, count.uc, count.ueu, + count.uer, count.ueo); + return 0; +} +DEFINE_SHOW_ATTRIBUTE(aest_node_err_count); + /*************************************************************************= ****** * * Attribute for AEST record @@ -37,6 +77,25 @@ DEFINE_AEST_DEBUGFS_ATTR(err_misc1, ERXMISC1); DEFINE_AEST_DEBUGFS_ATTR(err_misc2, ERXMISC2); DEFINE_AEST_DEBUGFS_ATTR(err_misc3, ERXMISC3); =20 +static int aest_record_err_count_show(struct seq_file *m, void *data) +{ + struct aest_record *record =3D m->private; + struct record_count count =3D { 0 }; + + aest_error_count(record, &count); + + seq_printf(m, "CE: %llu\n" + "DE: %llu\n" + "UC: %llu\n" + "UEU: %llu\n" + "UEO: %llu\n" + "UER: %llu\n", + count.ce, count.de, count.uc, count.ueu, + count.uer, count.ueo); + return 0; +} +DEFINE_SHOW_ATTRIBUTE(aest_record_err_count); + static void aest_record_init_debugfs(struct aest_record *record) { debugfs_create_file("err_fr", 0600, record->debugfs, record, @@ -55,6 +114,8 @@ static void aest_record_init_debugfs(struct aest_record = *record) &err_misc2_ops); debugfs_create_file("err_misc3", 0600, record->debugfs, record, &err_misc3_ops); + debugfs_create_file("err_count", 0400, record->debugfs, record, + &aest_record_err_count_fops); } =20 static void @@ -63,6 +124,9 @@ aest_node_init_debugfs(struct aest_node *node) int i; struct aest_record *record; =20 + debugfs_create_file("err_count", 0400, node->debugfs, node, + &aest_node_err_count_fops); + for (i =3D 0; i < node->record_count; i++) { record =3D &node->records[i]; if (!record->name) diff --git a/drivers/ras/aest/aest.h b/drivers/ras/aest/aest.h index ceb9e32bcee3..802430857dc4 100644 --- a/drivers/ras/aest/aest.h +++ b/drivers/ras/aest/aest.h @@ -116,6 +116,15 @@ struct ce_threshold { u64 reg_val; }; =20 +struct record_count { + u64 ce; + u64 de; + u64 uc; + u64 uer; + u64 ueo; + u64 ueu; +}; + struct aest_record { char *name; int index; @@ -136,6 +145,7 @@ struct aest_record { =20 struct ce_threshold ce; enum ras_ce_threshold threshold_type; + struct record_count count; struct dentry *debugfs; }; =20 --=20 2.51.2.612.gdc70283dfc