mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-05 11:00:15 +00:00
552c88273e
This patch is porting from linux: http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/ ?h=imx_4.1.15_1.0.0_ga&id=3d42fcece496224fde59f9343763fb2dfc5b0768 " We may meet the bitflips in reading an erased page(contains all 0xFF), this may causes the UBIFS corrupt, please see the log from Elie: ----------------------------------------------------------------- [ 3.831323] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry [ 3.845026] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry [ 3.858710] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry [ 3.872408] UBI error: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read 16384 bytes ... [ 4.011529] UBIFS error (pid 36): ubifs_recover_leb: corrupt empty space LEB 27:237568, corruption starts at 9815 [ 4.021897] UBIFS error (pid 36): ubifs_scanned_corruption: corruption at LEB 27:247383 [ 4.030000] UBIFS error (pid 36): ubifs_scanned_corruption: first 6569 bytes from LEB 27:247383 ----------------------------------------------------------------- This patch does a check for the uncorrectable failure in the following steps: [0] set the threshold. The threshold is set based on the truth: "A single 0 bit will lead to gf_len(13 or 14) bits 0 after the BCH do the ECC." For the sake of safe, we will set the threshold with half the gf_len, and do not make it bigger the ECC strength. [1] count the bitflips of the current ECC chunk, assume it is N. [2] if the (N <= threshold) is true, we continue to read out the page with ECC disabled. and we count the bitflips again, assume it is N2. (We read out the whole page, not just a chunk, this makes the check more strictly, and make the code more simple.) [3] if the (N2 <= threshold) is true again, we can regard this is a erased page. This is because a real erased page is full of 0xFF(maybe also has several bitflips), while a page contains the 0xFF data will definitely has many bitflips in the ECC parity areas. [4] if the [3] fails, we can regard this is a page filled with the '0xFF' data. " Signed-off-by: Peng Fan <peng.fan@nxp.com> |
||
---|---|---|
.. | ||
brcmnand | ||
am335x_spl_bch.c | ||
arasan_nfc.c | ||
atmel_nand.c | ||
atmel_nand_ecc.h | ||
davinci_nand.c | ||
denali.c | ||
denali.h | ||
denali_dt.c | ||
denali_spl.c | ||
fsl_elbc_nand.c | ||
fsl_elbc_spl.c | ||
fsl_ifc_nand.c | ||
fsl_ifc_spl.c | ||
fsl_upm.c | ||
fsmc_nand.c | ||
kb9202_nand.c | ||
Kconfig | ||
kirkwood_nand.c | ||
kmeter1_nand.c | ||
lpc32xx_nand_mlc.c | ||
lpc32xx_nand_slc.c | ||
Makefile | ||
mxc_nand.c | ||
mxc_nand.h | ||
mxc_nand_spl.c | ||
mxs_nand.c | ||
mxs_nand_dt.c | ||
mxs_nand_spl.c | ||
nand.c | ||
nand_base.c | ||
nand_bbt.c | ||
nand_bch.c | ||
nand_ecc.c | ||
nand_ids.c | ||
nand_plat.c | ||
nand_spl_load.c | ||
nand_spl_loaders.c | ||
nand_spl_simple.c | ||
nand_timings.c | ||
nand_util.c | ||
omap_elm.c | ||
omap_gpmc.c | ||
pxa3xx_nand.c | ||
pxa3xx_nand.h | ||
stm32_fmc2_nand.c | ||
sunxi_nand.c | ||
sunxi_nand_spl.c | ||
tegra_nand.c | ||
tegra_nand.h | ||
vf610_nfc.c | ||
zynq_nand.c |