]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: track maximum number of bitflips for each read request
authorMichał Kępień <kernel@kempniu.pl>
Wed, 29 Jun 2022 12:57:34 +0000 (14:57 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 21 Sep 2022 08:38:05 +0000 (10:38 +0200)
commit72d73726dfecca8c7d872f90aa3fba313885640f
tree8b0070a20c79e9139d62b1edfc65ee8971db7cc0
parent8518bb991dec58a5d7f63b977cf81a0431bb8869
mtd: track maximum number of bitflips for each read request

mtd_read_oob() callers are currently oblivious to the details of ECC
errors detected during the read operation - they only learn (through the
return value) whether any corrected bitflips or uncorrectable errors
occurred.  More detailed ECC information can be useful to user-space
applications for making better-informed choices about moving data
around.

Extend struct mtd_oob_ops with a pointer to a newly-introduced struct
mtd_req_stats and set its 'max_bitflips' field to the maximum number of
bitflips found in a single ECC step during the read operation performed
by mtd_read_oob().  This is a prerequisite for ultimately passing that
value back to user space.

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-2-kernel@kempniu.pl
drivers/mtd/mtdcore.c
include/linux/mtd/mtd.h