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(+)
--
2.7.4
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")
Signed-off-by: dillon min <[email protected]>
---
arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts b/arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts
index ecbb2cc5b9ab..79cc45728cd2 100644
--- a/arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts
+++ b/arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dts
@@ -14,5 +14,6 @@
};
&gpmi {
+ fsl,use-minimum-ecc;
status = "okay";
};
--
2.7.4
Hi Dillon,
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
> 22528 bytes from PEB 513:4096, read 22528 bytes
>
> Fixes: f9ecf10cb88c ("ARM: dts: imx6ull: add MYiR MYS-6ULX SBC")
> Signed-off-by: dillon min <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
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
>
> 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
--
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 |
Hi Sascha,
Thanks for reviewing.
On Tue, Mar 9, 2021 at 8:18 PM Sascha Hauer <[email protected]> wrote:
>
> 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
> >
> > 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.
>
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
> 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 |
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
> 22528 bytes from PEB 513:4096, read 22528 bytes
>
> Fixes: f9ecf10cb88c ("ARM: dts: imx6ull: add MYiR MYS-6ULX SBC")
> Signed-off-by: dillon min <[email protected]>
Applied, thanks.
On Wed, Mar 10, 2021 at 10:54:05AM +0800, dillon min wrote:
> Hi Sascha,
>
> Thanks for reviewing.
>
> On Tue, Mar 9, 2021 at 8:18 PM Sascha Hauer <[email protected]> wrote:
> >
> > 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
> > >
> > > 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.
> >
> 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
Then this is the justification for this patch, not anything from the
datasheet like you've written in your commit message.
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 |