]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: nand: use ECC, if present, when scanning OOB
authorBrian Norris <computersforpeace@gmail.com>
Fri, 22 Jun 2012 23:35:45 +0000 (16:35 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 17 Aug 2012 14:37:59 +0000 (17:37 +0300)
commit90094a7c31e61c8c63c53da5cae29a0496cd5aa2
treef84bac6fbaca5bce32eae0f8b8a1bf44fb4b57db
parent057ea4e7d4dc15cf4bf9b9f7a83f745fb22e6e68
mtd: nand: use ECC, if present, when scanning OOB

scan_read_raw_oob() is used in only in places where the MTD_OPS_PLACE_OOB mode
is preferable to MTD_OPS_RAW mode, so use MTD_OPS_PLACE_OOB instead.
MTD_OPS_PLACE_OOB provides the same functionality with the potential[1] added
bonus of error correction.

This brings scan_block_full() in line with scan_block_fast() so that they
both read bad block markers with MTD_OPS_PLACE_OOB. This can help in
preventing 0xff markers (in good blocks) from being interpreted as bad
block indicators in the presence of a single bitflip.

Note that ECC error codes (EUCLEAN or EBADMSG) are already silently
ignored in all users of scan_read_raw_oob().

[1] Few  drivers perform proper error correction on OOB data. In those
    cases, the use of MTD_OPS_RAW vs. MTD_OPS_PLACE_OOB is not
    significant.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/nand/nand_bbt.c