mirror of
https://github.com/torvalds/linux.git
synced 2024-11-02 10:11:36 +00:00
e2414f4c20
Currently, the flash-based BBT implementation writes bad block data only to its flash-based table and not to the OOB marker area. Then, as new bad blocks are marked over time, the OOB markers become incomplete and the flash-based table becomes the only source of current bad block information. This becomes an obvious problem when, for example: * bootloader cannot read the flash-based BBT format * BBT is corrupted and the flash must be rescanned for bad blocks; we want to remember bad blocks that were marked from Linux So to keep the bad block markers in sync with the flash-based BBT, this patch changes the default so that we write bad block markers to the proper OOB area on each block in addition to flash-based BBT. Comments are updated, expanded, and/or relocated as necessary. The new flash-based BBT procedure for marking bad blocks: (1) erase the affected block, to allow OOB marker to be written cleanly (2) update in-memory BBT (3) write bad block marker to OOB area of affected block (4) update flash-based BBT Note that we retain the first error encountered in (3) or (4), finish the procedures, and dump the error in the end. This should handle power cuts gracefully enough. (1) and (2) are mostly harmless (note that (1) will not erase an already-recognized bad block). The OOB and BBT may be "out of sync" if we experience power loss bewteen (3) and (4), but we can reasonably expect that on next boot, subsequent I/O operations will discover that the block should be marked bad again, thus re-syncing the OOB and BBT. Note that this is a change from the previous default flash-based BBT behavior. If your system cannot support writing bad block markers to OOB, use the new NAND_BBT_NO_OOB_BBM option (in combination with NAND_BBT_USE_FLASH and NAND_BBT_NO_OOB). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> |
||
---|---|---|
.. | ||
gpmi-nand | ||
alauda.c | ||
ams-delta.c | ||
atmel_nand_ecc.h | ||
atmel_nand.c | ||
au1550nd.c | ||
autcpu12.c | ||
bcm_umi_bch.c | ||
bcm_umi_nand.c | ||
bf5xx_nand.c | ||
cafe_nand.c | ||
cmx270_nand.c | ||
cs553x_nand.c | ||
davinci_nand.c | ||
denali.c | ||
denali.h | ||
diskonchip.c | ||
docg4.c | ||
fsl_elbc_nand.c | ||
fsl_upm.c | ||
fsmc_nand.c | ||
gpio.c | ||
h1910.c | ||
jz4740_nand.c | ||
Kconfig | ||
Makefile | ||
mpc5121_nfc.c | ||
mxc_nand.c | ||
nand_base.c | ||
nand_bbt.c | ||
nand_bch.c | ||
nand_bcm_umi.c | ||
nand_bcm_umi.h | ||
nand_ecc.c | ||
nand_ids.c | ||
nandsim.c | ||
ndfc.c | ||
nomadik_nand.c | ||
nuc900_nand.c | ||
omap2.c | ||
orion_nand.c | ||
pasemi_nand.c | ||
plat_nand.c | ||
ppchameleonevb.c | ||
pxa3xx_nand.c | ||
r852.c | ||
r852.h | ||
rtc_from4.c | ||
s3c2410.c | ||
sh_flctl.c | ||
sharpsl.c | ||
sm_common.c | ||
sm_common.h | ||
socrates_nand.c | ||
spia.c | ||
tmio_nand.c | ||
txx9ndfmc.c |