]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg
authorBoris Brezillon <bbrezillon@kernel.org>
Sun, 4 Nov 2018 13:43:37 +0000 (14:43 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 8 Apr 2019 08:21:08 +0000 (10:21 +0200)
commit167605fc545efedf677be06a25ece3fcc6b0652e
tree04b56af9accf4b06573fa8e3f6267cf3283768e9
parentbc498fe5c9c268adb741bb52c431ad082326605b
mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg

NAND datasheets usually give the maximum number of bad blocks per LUN
and this number can be used to help upper layers decide how much blocks
they should reserve for bad block handling.

Add a max_bad_eraseblocks_per_lun to the nand_memory_organization
struct and update the NAND_MEMORG() macro (and its users) accordingly.

We also provide a default mtd->_max_bad_blocks() implementation.

Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
drivers/mtd/nand/core.c
drivers/mtd/nand/spi/gigadevice.c
drivers/mtd/nand/spi/macronix.c
drivers/mtd/nand/spi/micron.c
drivers/mtd/nand/spi/toshiba.c
drivers/mtd/nand/spi/winbond.c
include/linux/mtd/nand.h