linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board
@ 2021-03-09  6:15 dillon.minfei
  2021-03-09  6:15 ` [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed dillon.minfei
  2021-03-09 12:18 ` [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board Sascha Hauer
  0 siblings, 2 replies; 7+ messages in thread
From: dillon.minfei @ 2021-03-09  6:15 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, parthiban, kernel, festevam,
	linux-imx, devicetree, linux-arm-kernel, linux-kernel
  Cc: dillon min

From: dillon min <dillon.minfei@gmail.com>

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed
  2021-03-09  6:15 [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board dillon.minfei
@ 2021-03-09  6:15 ` dillon.minfei
  2021-03-09 12:01   ` Fabio Estevam
  2021-03-17 13:00   ` Shawn Guo
  2021-03-09 12:18 ` [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board Sascha Hauer
  1 sibling, 2 replies; 7+ messages in thread
From: dillon.minfei @ 2021-03-09  6:15 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, parthiban, kernel, festevam,
	linux-imx, devicetree, linux-arm-kernel, linux-kernel
  Cc: dillon min

From: dillon min <dillon.minfei@gmail.com>

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 <dillon.minfei@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed
  2021-03-09  6:15 ` [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed dillon.minfei
@ 2021-03-09 12:01   ` Fabio Estevam
  2021-03-17 13:00   ` Shawn Guo
  1 sibling, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2021-03-09 12:01 UTC (permalink / raw)
  To: dillon.minfei
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Parthiban Nallathambi,
	Sascha Hauer, NXP Linux Team,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Dillon,

On Tue, Mar 9, 2021 at 3:15 AM <dillon.minfei@gmail.com> wrote:
>
> From: dillon min <dillon.minfei@gmail.com>
>
> 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 <dillon.minfei@gmail.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board
  2021-03-09  6:15 [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board dillon.minfei
  2021-03-09  6:15 ` [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed dillon.minfei
@ 2021-03-09 12:18 ` Sascha Hauer
  2021-03-10  2:54   ` dillon min
  1 sibling, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2021-03-09 12:18 UTC (permalink / raw)
  To: dillon.minfei
  Cc: robh+dt, shawnguo, parthiban, kernel, festevam, linux-imx,
	devicetree, linux-arm-kernel, linux-kernel

On Tue, Mar 09, 2021 at 02:15:19PM +0800, dillon.minfei@gmail.com wrote:
> From: dillon min <dillon.minfei@gmail.com>
> 
> 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 |

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board
  2021-03-09 12:18 ` [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board Sascha Hauer
@ 2021-03-10  2:54   ` dillon min
  2021-03-17 14:10     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: dillon min @ 2021-03-10  2:54 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Rob Herring, shawnguo, parthiban, kernel, festevam, linux-imx,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux ARM, Linux Kernel Mailing List

Hi Sascha,

Thanks for reviewing.

On Tue, Mar 9, 2021 at 8:18 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Tue, Mar 09, 2021 at 02:15:19PM +0800, dillon.minfei@gmail.com wrote:
> > From: dillon min <dillon.minfei@gmail.com>
> >
> > 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 |

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed
  2021-03-09  6:15 ` [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed dillon.minfei
  2021-03-09 12:01   ` Fabio Estevam
@ 2021-03-17 13:00   ` Shawn Guo
  1 sibling, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2021-03-17 13:00 UTC (permalink / raw)
  To: dillon.minfei
  Cc: robh+dt, s.hauer, parthiban, kernel, festevam, linux-imx,
	devicetree, linux-arm-kernel, linux-kernel

On Tue, Mar 09, 2021 at 02:15:20PM +0800, dillon.minfei@gmail.com wrote:
> From: dillon min <dillon.minfei@gmail.com>
> 
> 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 <dillon.minfei@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board
  2021-03-10  2:54   ` dillon min
@ 2021-03-17 14:10     ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2021-03-17 14:10 UTC (permalink / raw)
  To: dillon min
  Cc: Rob Herring, shawnguo, parthiban, kernel, festevam, linux-imx,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux ARM, Linux Kernel Mailing List

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 <s.hauer@pengutronix.de> wrote:
> >
> > On Tue, Mar 09, 2021 at 02:15:19PM +0800, dillon.minfei@gmail.com wrote:
> > > From: dillon min <dillon.minfei@gmail.com>
> > >
> > > 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 |

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-17 14:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09  6:15 [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board dillon.minfei
2021-03-09  6:15 ` [PATCH] ARM: dts: imx6ull: fix ubi filesystem mount failed dillon.minfei
2021-03-09 12:01   ` Fabio Estevam
2021-03-17 13:00   ` Shawn Guo
2021-03-09 12:18 ` [PATCH] ARM: dts: imx6ull: fix ubi mount failed on MYS-6ULX-IOT board Sascha Hauer
2021-03-10  2:54   ` dillon min
2021-03-17 14:10     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).