UBI issues with linux-stable 5.11.11

Trevor Woerner twoerner at gmail.com
Wed Apr 7 20:03:02 BST 2021


Hi,

I've been testing out some newer kernels on my lpc32xx board and found some
issues. My current stable build is running 5.0.19 and it is fine, and I have a
test build running 5.4.78 and it runs fine too.

My board has an S34ML04G1 SLC NAND:
	nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
	nand: AMD/Spansion S34ML04G1
	nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

The SLC portion of my device tree looks like:
	/* 512MB Flash via SLC NAND controller */
	&slc {
	       status = "okay";

	       nxp,wdr-clks = <14>;
	       nxp,wwidth = <70250000>;
	       nxp,whold = <281000000>;
	       nxp,wsetup = <100000000>;
	       nxp,rdr-clks = <14>;
	       nxp,rwidth = <93666666>;
	       nxp,rhold = <281000000>;
	       nxp,rsetup = <100000000>;
	       nand-on-flash-bbt;
	       gpios = <&gpio 5 19 1>; /* GPO_P3 19, active low */

	       partitions {
		       compatible = "fixed-partitions";
		       #address-cells = <1>;
		       #size-cells = <1>;

		       mtd0 at 0       { label = "bootrom";   reg = <0x00000000 0x00020000>; };
		       mtd1 at 20000   { label = "uboot";     reg = <0x00020000 0x00060000>; };
		       mtd2 at 80000   { label = "fbkernel";  reg = <0x00080000 0x003c0000>; };
		       mtd3 at 440000  { label = "fbrootfs";  reg = <0x00440000 0x004e0000>; };
		       mtd4 at 920000  { label = "c_kernel";  reg = <0x00920000 0x003c0000>; };
		       mtd5 at ce0000  { label = "c__atags";  reg = <0x00ce0000 0x00020000>; };
		       mtd6 at d00000  { label = "c_rootfs";  reg = <0x00d00000 0x00300000>; };
		       mtd7 at 1000000 { label = "mender";    reg = <0x01000000 0x1f000000>; };
	       };
	};

And my kernel parameters are:
	ubi.mtd=7,512 rootfstype=ubifs root=ubi0

When running linux-stable 5.11.11 (aa7258f8f3d48a29bc024ea8c5145bdc4a980e4d
from branch linux-5.11.y) I get the following on bootup:
	…
	nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
	nand: AMD/Spansion S34ML04G1
	nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
	Bad block table found at page 262080, version 0x01
	Bad block table found at page 262016, version 0x01
	random: fast init done
	nand_bbt: ECC error in BBT at 0x00001ffe0000
	nand_bbt: ECC error in BBT at 0x00001ffc0000
	Scanning device for bad blocks
	Bad block table written to 0x00001ffe0000, version 0x01
	Bad block table written to 0x00001ffc0000, version 0x01
	8 fixed-partitions partitions found on MTD device nxp_lpc3220_slc
	Creating 8 MTD partitions on "nxp_lpc3220_slc":
	0x000000000000-0x000000020000 : "bootrom"
	0x000000020000-0x000000080000 : "uboot"
	0x000000080000-0x000000440000 : "fbkernel"
	0x000000440000-0x000000920000 : "fbrootfs"
	0x000000920000-0x000000ce0000 : "c_kernel"
	0x000000ce0000-0x000000d00000 : "c__atags"
	0x000000d00000-0x000001000000 : "c_rootfs"
	0x000001000000-0x000020000000 : "mender"
	…
	ubi0: attaching mtd7
	ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
	ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
	ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
	ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
	CPU: 0 PID: 1 Comm: swapper Not tainted 5.11.11-yocto-standard #1
	Hardware name: LPC32XX SoC (Flattened Device Tree)
	[<c0011ac4>] (unwind_backtrace) from [<c00109c8>] (show_stack+0x10/0x14)
	[<c00109c8>] (show_stack) from [<c0300e00>] (ubi_io_read+0x20c/0x2d8)
	[<c0300e00>] (ubi_io_read) from [<c030110c>] (ubi_io_read_ec_hdr+0x68/0x20c)
	[<c030110c>] (ubi_io_read_ec_hdr) from [<c03064dc>] (ubi_attach+0x2d8/0x11dc)
	[<c03064dc>] (ubi_attach) from [<c02fb768>] (ubi_attach_mtd_dev+0x584/0xa10)
	[<c02fb768>] (ubi_attach_mtd_dev) from [<c06bf730>] (ubi_init+0x1a8/0x214)
	[<c06bf730>] (ubi_init) from [<c06a8f44>] (do_one_initcall+0x74/0x188)
	[<c06a8f44>] (do_one_initcall) from [<c06a921c>] (kernel_init_freeable+0x170/0x1bc)
	[<c06a921c>] (kernel_init_freeable) from [<c0557c54>] (kernel_init+0x8/0xf8)
	[<c0557c54>] (kernel_init) from [<c0008528>] (ret_from_fork+0x14/0x2c)
	Exception stack(0xc0825fb0 to 0xc0825ff8)
	5fa0:                                     00000000 00000000 00000000 00000000
	5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
	…

The preceeding repeats over and over, the only difference being the PEB number
changing.

I found this which looks relevant: https://linux-sunxi.org/Mainline_NAND_Howto#Many_bad_blocks
I realize it's for a different SoC and NAND chip, but would it be worth
trying this procedure on my system?

Best regards,
	Trevor



More information about the linux-mtd mailing list