]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
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@freescale.com>
Fri, 16 Jan 2015 03:20:01 +0000 (21:20 -0600)
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 from commit d957353768a1b6d39b340b9d10b22fc42b0aa8e2)

arch/arm/boot/dts/imx6q-arm2.dts
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
arch/arm/boot/dts/imx6sx-17x17-arm2-gpmi-weim.dts
arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts
arch/arm/boot/dts/imx6sx-sabreauto.dts

index 010ee8cd5ed945cae93761e619ce544f78ee16a3..cb650401411a6b76705d95a896311718bfe95bf1 100644 (file)
@@ -61,6 +61,7 @@
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpmi_nand>;
        status = "disabled"; /* gpmi nand conflicts with SD */
+       nand-on-flash-bbt;
 };
 
 &iomuxc {
index 83c427e0735acbd0d645b4422de6313b91644c2d..0987f868954d4084a47244f07f6539377a4ab64d 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpmi_nand>;
        status = "okay";
+       nand-on-flash-bbt;
 };
 
 &i2c2 {
index 8b0833c8d251cf3f4616d3e544e48e789956ab89..e1d883157cee394e5cfa2852dc9a192aefef95ed 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpmi_nand_1>;
        status = "okay"; /* pin conflict with qspi*/
+       nand-on-flash-bbt;
 };
 
 &uart1 {
index 88d1cdb0d5f45e1f3d901c42f329263a15d980ce..a50f335adb806e1c7560e250ce5bcef4697318b7 100644 (file)
@@ -16,4 +16,5 @@
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpmi_nand_1>;
        status = "okay"; /* pin conflict with qspi*/
+       nand-on-flash-bbt;
 };
index b0ca9f57309037d88e43412c4b6441fda84911ad..14c7adb8d36fc9ea86d3f4595290a42e2773ad19 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpmi_nand_1>;
        status = "okay";
+       nand-on-flash-bbt;
 };
 
 &vadc {