[PATCH v3 02/10] ubi: Expose mean erase counter for fastmap in sysfs
Richard Weinberger
richard at nod.at
Wed Nov 6 12:20:26 PST 2024
Rickard,
----- Ursprüngliche Mail -----
> Von: "Rickard X Andersson" <rickard.andersson at axis.com>
> An: "richard" <richard at nod.at>, "chengzhihao1" <chengzhihao1 at huawei.com>, "linux-mtd" <linux-mtd at lists.infradead.org>,
> "rickard314 andersson" <rickard314.andersson at gmail.com>
> CC: "Rickard X Andersson" <rickard.andersson at axis.com>, "kernel" <kernel at axis.com>
> Gesendet: Freitag, 11. Oktober 2024 14:58:56
> Betreff: [PATCH v3 02/10] ubi: Expose mean erase counter for fastmap in sysfs
> Since the fastmap area has its own wear levelling it is valuable to
> provide a mean value for that area. This value can be used in order
> to estimate life expectancy of the flash.
>
> Reviewed-by: Zhihao Cheng <chengzhihao1 at huawei.com>
> Signed-off-by: Rickard Andersson <rickard.andersson at axis.com>
> ---
> drivers/mtd/ubi/build.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index 231ca288f397..1c531d623a62 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -133,6 +133,10 @@ static struct device_attribute dev_max_ec =
> __ATTR(max_ec, S_IRUGO, dev_attribute_show, NULL);
> static struct device_attribute dev_mean_ec =
> __ATTR(mean_ec, S_IRUGO, dev_attribute_show, NULL);
> +#ifdef CONFIG_MTD_UBI_FASTMAP
> +static struct device_attribute dev_mean_ec_fastmap =
> + __ATTR(mean_ec_fastmap, S_IRUGO, dev_attribute_show, NULL);
> +#endif
Do you really need distinct sysfs attributes for the fastmap and the
non-fastmap case? Userspace does not care whether fastmap is used or
not, all userspace is interested in is the mean erase counter value.
IMHO, the mean_ec attribute should combine the mean EC values from
the fastmap and the data area.
Thanks,
//richard
More information about the linux-mtd
mailing list