[PATCH 3/8] ras: aest: Skip unimplemented records in debugfs

Umang Chheda
2026-05-05T12:25:19Z

The record_implemented bitmap uses the same semantics as the rest of
the driver: a SET bit means the record is NOT implemented (skip it),
a CLEAR bit means the record IS implemented (process it).

aest_node_init_debugfs() and aest_node_err_count_show() were iterating
all record_count records unconditionally, creating debugfs entries and
accumulating error counts for unimplemented records too.

Fix both functions to skip records where the corresponding bit is set
in node->record_implemented, consistent with how aest_node_foreach_record()
handles the same bitmap.

Signed-off-by: Umang Chheda <umang.chheda@oss.qualcomm.com>
---
drivers/ras/aest/aest-sysfs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/ras/aest/aest-sysfs.c b/drivers/ras/aest/aest-sysfs.c
index f710503e4d74..b36190bb3b3e 100644
--- a/drivers/ras/aest/aest-sysfs.c
+++ b/drivers/ras/aest/aest-sysfs.c
@@ -52,7 +52,8 @@ static int aest_node_err_count_show(struct seq_file *m, void *data)
int i;

for (i = 0; i < node->record_count; i++)
- aest_error_count(&node->records[i], &count);
+ if (!test_bit(i, node->record_implemented))
+ aest_error_count(&node->records[i], &count);

seq_printf(m, "CE: %llu\n"
"DE: %llu\n"
@@ -174,8 +175,11 @@ aest_node_init_debugfs(struct aest_node *node)
record = &node->records[i];
if (!record->name)
continue;
+ /* Skip records not implemented on this node. */
+ if (test_bit(i, node->record_implemented))
+ continue;
record->debugfs = debugfs_create_dir(record->name,
- node->debugfs);
+ node->debugfs);
aest_record_init_debugfs(record);
}
}

--
2.34.1