diff options
author | Daniel Golle <daniel@makrotopia.org> | 2024-08-12 02:56:41 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2024-08-23 19:29:18 +0200 |
commit | 1824520e7477bedf76bd08c32261c755e6405cd9 (patch) | |
tree | 8635af3d83b1b5308ed58dfbee97f02fe60443ec /drivers/mtd | |
parent | e2a9fcb36e851adb5b25c4acea53a290fd48a636 (diff) |
mtd: spinand: set bitflip_threshold to 75% of ECC strength
Reporting an unclean read from SPI-NAND only when the maximum number
of correctable bitflip errors has been hit seems a bit late.
UBI LEB scrubbing, which depends on the lower MTD device reporting
correctable bitflips, then only kicks in when it's almost too late.
Set bitflip_threshold to 75% of the ECC strength, which is also the
default for raw NAND.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/2117e387260b0a96f95b8e1652ff79e0e2d71d53.1723427450.git.daniel@makrotopia.org
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/spi/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index e0b6715e5dfe..018c854d0619 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1287,6 +1287,7 @@ static int spinand_init(struct spinand_device *spinand) /* Propagate ECC information to mtd_info */ mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength; mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size; + mtd->bitflip_threshold = DIV_ROUND_UP(mtd->ecc_strength * 3, 4); ret = spinand_create_dirmaps(spinand); if (ret) { |