Skip to content

mtd: nand: improve flash-based BBT robustness

Brian Norris linux-mtd 1 version Applied

Status from this message: Pushed to my tree, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/14mtd: nand: refactor scanning codedrivers/mtd/nand/nand_bbt.c+8 -201 reply
2/14mtd: nand: do not ignore all ECC errorsdrivers/mtd/nand/nand_bbt.c+3 -31 reply
3/14mtd: define `is_ecc_error()' macrosinclude/linux/mtd/mtd.h+5 -07 replies
4/14mtd: utilize `is_ecc_error()' macrosdrivers/mtd/inftlcore.c drivers/mtd/mtdchar.c drivers/mtd/mtdconcat.c +20 more+84 -781 reply
5/14mtd: nand: remove unnecessary variabledrivers/mtd/nand/nand_bbt.c+3 -51 reply
6/14mtd: nand: fix styledrivers/mtd/nand/nand_bbt.c+14 -141 reply
7/14mtd: nand: begin restructuring check_createdrivers/mtd/nand/nand_bbt.c+5 -190 replies
8/14mtd: nand: remove gotos in `check_create()'drivers/mtd/nand/nand_bbt.c+19 -160 replies
9/14mtd: nand: report ECC errors properly when reading BBTdrivers/mtd/nand/nand_bbt.c+12 -51 reply
10/14mtd: nand: scrub BBT on ECC errorsdrivers/mtd/nand/nand_bbt.c+24 -51 reply
11/14mtd: nand: wait to set BBT versiondrivers/mtd/nand/nand_bbt.c+8 -41 reply
12/14mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB setdrivers/mtd/nand/nand_bbt.c+7 -61 reply
13/14mtd: nand: invalidate cache on unaligned readsdrivers/mtd/nand/nand_base.c+10 -20 replies
14/14mtd: nand: switch `check_pattern()' to standard `memcmp()'drivers/mtd/nand/nand_bbt.c+2 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] mtd: nand: improve flash-based BBT robustness

Hello,

This patch series aims to improve the robustness of flash-based bad block tables, especially their ECC handling. In fact, most of the patches simply build up to the changes in patch 9 and 10, with some following bugfixes and improvements that were discovered as a result of the optimizations.

It's worth noting here the intended block scrubbing policy so that it can be checked for soundness and for implementation:

*) a BBT page with uncorrected ECC errors is invalid
*) a BBT page with corrected ECC errors is valid but needs scrubbing
(erased and rewritten with corrected data)

Upon discovering invalid table page(s), we retry our table versioning in this order:

(1) Mirrored table of same version
(2) Mirrored table of lesser version
(3) Rescan flash for bad blocks

After yielding the most up-to-date table (from table in flash or from scanning the device), then if the flash-BBT is out of date or needs scrubbing, the table should be rewritten.

Let me know how any of this works and if there are particular areas where documentation or explanation is lacking.

Brian

Brian Norris (14):
mtd: nand: refactor scanning code
mtd: nand: do not ignore all ECC errors
mtd: define `is_ecc_error()' macros
mtd: utilize `is_ecc_error()' macros
mtd: nand: remove unnecessary variable
mtd: nand: fix style
mtd: nand: begin restructuring check_create
mtd: nand: remove gotos in `check_create()'
mtd: nand: report ECC errors properly when reading BBT
mtd: nand: scrub BBT on ECC errors
mtd: nand: wait to set BBT version
mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set
mtd: nand: invalidate cache on unaligned reads
mtd: nand: switch check_pattern()' to standard memcmp()'

 drivers/mtd/inftlcore.c             |    4 +-
 drivers/mtd/mtdchar.c               |    4 +-
 drivers/mtd/mtdconcat.c             |    8 +-
 drivers/mtd/mtdoops.c               |    2 +-
 drivers/mtd/mtdpart.c               |    8 +-
 drivers/mtd/mtdswap.c               |   20 ++--
 drivers/mtd/nand/diskonchip.c       |    2 +-
 drivers/mtd/nand/nand_base.c        |   12 ++-
 drivers/mtd/nand/nand_bbt.c         |  198 ++++++++++++++++++-----------------
 drivers/mtd/nftlcore.c              |    4 +-
 drivers/mtd/onenand/onenand_base.c  |   11 +-
 drivers/mtd/sm_ftl.c                |    4 +-
 drivers/mtd/tests/mtd_pagetest.c    |   28 +++---
 drivers/mtd/tests/mtd_readtest.c    |    2 +-
 drivers/mtd/tests/mtd_speedtest.c   |    8 +-
 drivers/mtd/tests/mtd_stresstest.c  |    2 +-
 drivers/mtd/tests/mtd_subpagetest.c |    9 +-
 drivers/mtd/tests/mtd_torturetest.c |    2 +-
 drivers/mtd/ubi/eba.c               |    2 +-
 drivers/mtd/ubi/io.c                |   27 +++--
 drivers/mtd/ubi/kapi.c              |    3 +-
 drivers/mtd/ubi/misc.c              |    2 +-
 drivers/mtd/ubi/scan.c              |    4 +-
 drivers/mtd/ubi/vtbl.c              |    2 +-
 include/linux/mtd/mtd.h             |    5 +
 25 files changed, 198 insertions(+), 175 deletions(-)
Signature · 1 line
1.7.5.4