Issues reading large files from nand ubifs ARM64

Matthew Rainey mrainey at aeronix.com
Mon Apr 8 16:14:05 CEST 2024


Hello U-Boot community,

I am having issues reading large files (~20 MiB and larger) from nand flash on an arm64 development board. Smaller files load and work as intended. I have tested this in linux, which also works as intended. However, in U-Boot, it gives the following error:

ubifsload 0x90000000 "core-image-minimal-ls1046afrwy.cpio.gz.u-boot"
Loading file 'core-image-minimal-ls1046afrwy.cpio.gz.u-boot' to addr 0x90000000...
UBIFS error (ubi0:0 pid 0): do_readpage: cannot read page 5553 of inode 66, error -12
Error reading file 'core-image-minimal-ls1046afrwy.cpio.gz.u-boot'
** File not found core-image-minimal-ls1046afrwy.cpio.gz.u-boot **

It seems to fail on a random page between 300 and 6000. Nand reads after this error cause U-Boot to panic.

Digging a bit deeper, error -12 (-ENOMEM) seems to come from line 274 and 413 in tnc_misc.c. It seems to alternate between the two.
https://github.com/u-boot/u-boot/blob/master/fs/ubifs/tnc_misc.c

I looked around and don’t see an obvious memory leak. I have 4 GiB of ram, which should be plenty. This issue also doesn’t exist using just UBI (not ubifs) to the same location, so It feels like the ubifs driver is messing up. I have tried U-Boot 2019.10 and 2022.04, and they both present the same issue.

I’m using this to load a rootfs ramdisk (~141 MiB) into ram. As an absolute last resort, I could split the rootfs into 16 MiB files, and stitch them together in u-boot. Hopefully I won’t have to do that 😊

If you need additional information, please do not hesitate to contact me.
Thank you,
Matt


More information about the U-Boot mailing list