]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: core: expose ooblayout information via debugfs
authorGabor Juhos <j4g8y7@gmail.com>
Fri, 8 Aug 2025 10:13:44 +0000 (12:13 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 11 Sep 2025 15:34:15 +0000 (17:34 +0200)
commite3d2faffdd18a545caccb1d249603cf286289d0f
treec9630ba796a1c6b8bfc5e0342d406bc355cebbb6
parent0ee8d7616b7563f53a904acf91db1675937d4196
mtd: core: expose ooblayout information via debugfs

Add two new debugfs files which allows to determine the OOB layout
used by a given MTD device. This can be useful to verify the current
layout during driver development without adding extra debug code.
The exposed information also makes it easier to analyze NAND dumps
without the need of crawling out the layout from the driver code.

The content of the new debugfs files is similar to this:

    # cat /sys/kernel/debug/mtd/mtd0/ooblayout_ecc
    0      0   49
    1     65   63
    # cat /sys/kernel/debug/mtd/mtd0/ooblayout_free
    0     49   16

Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/mtdcore.c