[RFC PATCH 05/11] soc: mediatek: dram-ecc: add error counters and the address lists
Krzysztof Kozlowski
krzk at kernel.org
Mon Nov 2 05:42:34 PST 2026
On 02/11/2026 10:23, santino.wang wrote:
> +
> +static ssize_t by_ce_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sysfs_emit(buf, "%llu\n", mtk_dram_ecc_get_retired_by_ce());
> +}
> +
> +static ssize_t by_uce_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sysfs_emit(buf, "%llu\n", mtk_dram_ecc_get_retired_by_uce());
> +}
> +
> +static struct kobj_attribute retired_by_ce_attr = __ATTR_RO(by_ce);
> +static struct kobj_attribute retired_by_uce_attr = __ATTR_RO(by_uce);
> +
> +static struct attribute *retired_attrs[] = {
> + &retired_by_ce_attr.attr,
> + &retired_by_uce_attr.attr,
> + NULL,
> +};
> +
> +static const struct attribute_group retired_group = {
> + .attrs = retired_attrs,
> +};
> +
> +int mtk_dram_ecc_counters_init(struct kobject *parent)
> +{
> + int ret;
> +
> + counters_kobj = kobject_create_and_add("counters", parent);
> + if (!counters_kobj)
> + return -ENOMEM;
> +
> + ret = sysfs_create_group(counters_kobj, &group);
> + if (ret) {
> + kobject_put(counters_kobj);
> + return ret;
> + }
> +
Sorry, but no. You do not get your own interface, especially
undocumented one. Use existing subsystems. Also, drivers/soc/ cannot
expose interface to user space.
Best regards,
Krzysztof
More information about the linux-arm-kernel
mailing list