Skip to contentSkip to conversation

ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board

PATCH Superseded [email protected] 4 participants 7 messages Mar 9, 2021 – Mar 17, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board

From: dillon min <[email protected]>

This patch intend to fix ubi filesystem mount failed on MYS-6ULX-IOT board, from Micron MT29F2G08ABAEAWP's datasheets, we need to choose 4-bit ECC.

Table 18: Error Management Details

Description Requirement

Minimum number of valid blocks (NVB) per LUN 2008
Total available blocks per LUN 2048
First spare area location x8: byte 2048 x16: word 1024
Bad-block mark x8: 00h x16: 0000h
Minimum required ECC 4-bit ECC per 528 bytes
Minimum ECC with internal ECC enabled 4-bit ECC per 516 bytes (user data) + 8
bytes (parity data)
Minimum required ECC for block 0 if PROGRAM/
ERASE cycles are less than 1000 1-bit ECC per 528 bytes

dillon min (1):
ARM: dts: imx6ull: fix ubi filesystem mount failed

 arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 ARM: dts: imx6ull: fix ubi filesystem mount failed

From: dillon min <[email protected]>

since Micron MT29F2G08ABAEAWP's ecc error management:

|Description           			| Requirement
|Minimum required ECC  			| 4-bit ECC per 528 bytes
|Minimum ECC with internal ECC enabled  | 4-bit ECC per 516 bytes (user data) +

8bytes (parity data)

to avoid unnecessary overheads related to bigger ecc calculations. need choose to use fsl,use-minimum-ecc, else will run into ecc error.

[    9.449265] ubi0: scanning is finished
[    9.463968] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.486940] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.509906] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.532845] ubi0 error: ubi_io_read: error -74 (ECC error) while reading

22528 bytes from PEB 513:4096, read 22528 bytes

Fixes f9ecf10cb88c ("ARM: dts: imx6ull: add MYiR MYS-6ULX SBC")
---
 arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts +1 -0
index ecbb2cc5b9ab..79cc45728cd2 100644
@@ -14,5 +14,6 @@
 };
 
 &gpmi {
+	fsl,use-minimum-ecc;
 	status = "okay";
 };
Signature · 1 line
2.7.4
reviewer Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed

Hi Dillon,

Quoted 21 lines · On Tue, Mar 9, 2021 at 3:15 AM <[email protected]> wrote:

From: dillon min <[email protected]>

since Micron MT29F2G08ABAEAWP's ecc error management:

|Description                            | Requirement
|Minimum required ECC                   | 4-bit ECC per 528 bytes
|Minimum ECC with internal ECC enabled  | 4-bit ECC per 516 bytes (user data) +

8bytes (parity data)

to avoid unnecessary overheads related to bigger ecc calculations. need choose to use fsl,use-minimum-ecc, else will run into ecc error.

[    9.449265] ubi0: scanning is finished
[    9.463968] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.486940] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.509906] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.532845] ubi0 error: ubi_io_read: error -74 (ECC error) while reading
Quoted 4 lines

22528 bytes from PEB 513:4096, read 22528 bytes

Fixes f9ecf10cb88c ("ARM: dts: imx6ull: add MYiR MYS-6ULX SBC")
Applied
#3 lore raw

Re: [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed

In reply to [email protected]
Quoted 20 lines · On Tue, Mar 09, 2021 at 02:15:20PM +0800, [email protected] wrote:

From: dillon min <[email protected]>

since Micron MT29F2G08ABAEAWP's ecc error management:

|Description           			| Requirement
|Minimum required ECC  			| 4-bit ECC per 528 bytes
|Minimum ECC with internal ECC enabled  | 4-bit ECC per 516 bytes (user data) +

8bytes (parity data)

to avoid unnecessary overheads related to bigger ecc calculations. need choose to use fsl,use-minimum-ecc, else will run into ecc error.

[    9.449265] ubi0: scanning is finished
[    9.463968] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.486940] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.509906] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading
22528 bytes from PEB 513:4096, read only 22528 bytes, retry
[    9.532845] ubi0 error: ubi_io_read: error -74 (ECC error) while reading
Quoted 4 lines

22528 bytes from PEB 513:4096, read 22528 bytes

Fixes f9ecf10cb88c ("ARM: dts: imx6ull: add MYiR MYS-6ULX SBC")

Applied, thanks.

maintainer
#4 lore raw
In reply to [email protected]
Quoted 9 lines · On Tue, Mar 09, 2021 at 02:15:19PM +0800, [email protected] wrote:

From: dillon min <[email protected]>

This patch intend to fix ubi filesystem mount failed on MYS-6ULX-IOT board, from Micron MT29F2G08ABAEAWP's datasheets, we need to choose 4-bit ECC.

Table 18: Error Management Details

Description Requirement

Quoted 9 lines

Minimum number of valid blocks (NVB) per LUN 2008
Total available blocks per LUN 2048
First spare area location x8: byte 2048 x16: word 1024
Bad-block mark x8: 00h x16: 0000h
Minimum required ECC 4-bit ECC per 528 bytes
Minimum ECC with internal ECC enabled 4-bit ECC per 516 bytes (user data) + 8
bytes (parity data)
Minimum required ECC for block 0 if PROGRAM/
ERASE cycles are less than 1000 1-bit ECC per 528 bytes

4-bit ECC is the minimum this chip requires. There's nothing wrong with choosing a better ECC like the GPMI driver does by default.

It looks like you are papering over some other problem.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#5 lore raw

Hi Sascha,

Thanks for reviewing.

Quoted 21 lines · Sascha Hauer
Quoted 9 lines · On Tue, Mar 09, 2021 at 02:15:19PM +0800, [email protected] wrote:

From: dillon min <[email protected]>

This patch intend to fix ubi filesystem mount failed on MYS-6ULX-IOT board, from Micron MT29F2G08ABAEAWP's datasheets, we need to choose 4-bit ECC.

Table 18: Error Management Details

Description Requirement

Quoted 9 lines

Minimum number of valid blocks (NVB) per LUN 2008
Total available blocks per LUN 2048
First spare area location x8: byte 2048 x16: word 1024
Bad-block mark x8: 00h x16: 0000h
Minimum required ECC 4-bit ECC per 528 bytes
Minimum ECC with internal ECC enabled 4-bit ECC per 516 bytes (user data) + 8
bytes (parity data)
Minimum required ECC for block 0 if PROGRAM/
ERASE cycles are less than 1000 1-bit ECC per 528 bytes

Quoted 3 lines

4-bit ECC is the minimum this chip requires. There's nothing wrong with choosing a better ECC like the GPMI driver does by default.

Yes, indeed, the mt29f2g08's minimum ecc is 4-bit, you can use 8-bits ecc. but there is a dependency between new kernel gpmi-nand with the old mfg-kernel's , which means
if the old nand ecc layout is 4-bits, you should use ecc 4-bit in the new kernel (by fsl,use-minimum-ecc),
else use 8-bits.

For my case, the ubifs filesystem was created by ecc 4-bits, without reflash filesystem or change
gpmi-nand.c , so the better way is to use dts configure.

use legacy_set_geometry() :

[    6.713115] GF length              : 13
[    6.713115] ECC Strength           : 8
[    6.713115] Page Size in Bytes     : 2110
[    6.713115] Metadata Size in Bytes : 10
[    6.713115] ECC Chunk Size in Bytes: 512
[    6.713115] ECC Chunk Count        : 4
[    6.713115] Payload Size in Bytes  : 2048
[    6.713115] Auxiliary Size in Bytes: 16
[    6.713115] Auxiliary Status Offset: 12
[    6.713115] Block Mark Byte Offset : 1999
[    6.713115] Block Mark Bit Offset  : 0

use set_geometry_by_ecc_info()

[    6.701262] GF length              : 13
[    6.701262] ECC Strength           : 4
[    6.701262] Page Size in Bytes     : 2084
[    6.701262] Metadata Size in Bytes : 10
[    6.701262] ECC Chunk Size in Bytes: 512
[    6.701262] ECC Chunk Count        : 4
[    6.701262] Payload Size in Bytes  : 2048
[    6.701262] Auxiliary Size in Bytes: 16
[    6.701262] Auxiliary Status Offset: 12
[    6.701262] Block Mark Byte Offset : 2018
[    6.701262] Block Mark Bit Offset  : 4

here are some background tips (fsl,use-minimum-ecc) for your refer:

The bug was submitted in regression test,
[1] https://linux-mtd.infradead.narkive.com/hfRFPn3P/gpmi-mtd-ecc-regression

First patch to fix it
[2] https://stable.vger.kernel.narkive.com/mupPGUPj/patch-v2-mtd-gpmi-fix-the-ecc-regression

Introduce devicetree to configure by user(more flexibility)
[3] https://linux-mtd.infradead.narkive.com/tqQZ75Iz/patch-v2-mtd-gpmi-add-a-new-dt-property-to-use-the-datasheet-s-minimum-required-ecc

Quoted 9 lines

It looks like you are papering over some other problem.

Sascha

--

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
maintainer
#6 lore raw
Quoted 36 lines · dillon min

Hi Sascha,

Thanks for reviewing.

Quoted 21 lines · Sascha Hauer
Quoted 9 lines · On Tue, Mar 09, 2021 at 02:15:19PM +0800, [email protected] wrote:

From: dillon min <[email protected]>

This patch intend to fix ubi filesystem mount failed on MYS-6ULX-IOT board, from Micron MT29F2G08ABAEAWP's datasheets, we need to choose 4-bit ECC.

Table 18: Error Management Details

Description Requirement

Quoted 9 lines

Minimum number of valid blocks (NVB) per LUN 2008
Total available blocks per LUN 2048
First spare area location x8: byte 2048 x16: word 1024
Bad-block mark x8: 00h x16: 0000h
Minimum required ECC 4-bit ECC per 528 bytes
Minimum ECC with internal ECC enabled 4-bit ECC per 516 bytes (user data) + 8
bytes (parity data)
Minimum required ECC for block 0 if PROGRAM/
ERASE cycles are less than 1000 1-bit ECC per 528 bytes

Quoted 3 lines

4-bit ECC is the minimum this chip requires. There's nothing wrong with choosing a better ECC like the GPMI driver does by default.

Yes, indeed, the mt29f2g08's minimum ecc is 4-bit, you can use 8-bits ecc. but there is a dependency between new kernel gpmi-nand with the old mfg-kernel's , which means
if the old nand ecc layout is 4-bits, you should use ecc 4-bit in the new kernel (by fsl,use-minimum-ecc),
else use 8-bits.

Quoted 2 lines

For my case, the ubifs filesystem was created by ecc 4-bits, without reflash filesystem or change

Then this is the justification for this patch, not anything from the datasheet like you've written in your commit message.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |