MLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed
authorAllen Xu <b45815@freescale.com>
Tue, 9 Dec 2014 22:12:00 +0000 (06:12 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:24 +0000 (14:49 -0500)
commit7e2e59f8704b48e30efcbe2c59f63563872c4d31
tree6e8bdee3683330aee5d8be18c23bd6f4dd809e9f
parentf1d2361dfc757462ab0dc459f162911eb26270ae
MLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed

NAND scans the bad blocks during kernel boots up, which invokes the
gpmi_ecc_read_oob function to check the badblock mark for each block. In
this function the oob data was raw read from NAND chip without ECC, so
it hardly to guarantee the consistency of the data considering the
possible bitflips. It found that in some MLC NAND the oob data changed
and consequently the BBT changed in different power cycles. This issue
may cause the UBIFS mount failed.

To fix this issue, add "nand_on_flash_bbt" option in dts to store the BBT
in NAND flash. On the first time kernel boot up, all bad blocks and
probably some fake bad block would be recognized and be recorded in
on-nand bad block table. From the second time boot, kernel will read BBT
from NAND Flash rather than calling gpmi_ecc_read_oob function to check
bad block.

No bad block would be missed when create BBT since the probability that
16bit bad block mark filps from 0x00 to 0xFF is extremely low.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked and merge from commit d957353768a1b6d39b340b9d10b22fc42b0aa8e2)
(cherry picked from commit 7b7d3d683a24b23f33d6c08874f31fe50ef2fc76)
arch/arm/boot/dts/imx6q-arm2.dts
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts
arch/arm/boot/dts/imx6sx-sabreauto.dts