From 7e2e59f8704b48e30efcbe2c59f63563872c4d31 Mon Sep 17 00:00:00 2001 From: Allen Xu Date: Wed, 10 Dec 2014 06:12:00 +0800 Subject: [PATCH] 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 (cherry picked and merge from commit d957353768a1b6d39b340b9d10b22fc42b0aa8e2) (cherry picked from commit 7b7d3d683a24b23f33d6c08874f31fe50ef2fc76) --- arch/arm/boot/dts/imx6q-arm2.dts | 1 + arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 1 + arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts | 1 + arch/arm/boot/dts/imx6sx-sabreauto.dts | 1 + 4 files changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts index 430778c2219d..7793d73839e6 100644 --- a/arch/arm/boot/dts/imx6q-arm2.dts +++ b/arch/arm/boot/dts/imx6q-arm2.dts @@ -62,6 +62,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpmi_nand>; status = "disabled"; /* gpmi nand conflicts with SD */ + nand-on-flash-bbt; }; &iomuxc { diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index d2dd05de210f..773eb695c1b9 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -349,6 +349,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpmi_nand>; status = "okay"; + nand-on-flash-bbt; }; &hdmi_audio { diff --git a/arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts b/arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts index 88d1cdb0d5f4..a50f335adb80 100644 --- a/arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts +++ b/arch/arm/boot/dts/imx6sx-19x19-arm2-gpmi-weim.dts @@ -16,4 +16,5 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpmi_nand_1>; status = "okay"; /* pin conflict with qspi*/ + nand-on-flash-bbt; }; diff --git a/arch/arm/boot/dts/imx6sx-sabreauto.dts b/arch/arm/boot/dts/imx6sx-sabreauto.dts index f172598f5ea8..1215d93e8e7d 100644 --- a/arch/arm/boot/dts/imx6sx-sabreauto.dts +++ b/arch/arm/boot/dts/imx6sx-sabreauto.dts @@ -707,6 +707,7 @@ dcic_id = <1>; dcic_mux = "dcic-lvds"; status = "okay"; + nand-on-flash-bbt; }; &vadc { -- 2.17.1