[PATCH] fw_env: keep calling read() until whole flash block is read
Tom Rini
trini at konsulko.com
Sat Jan 6 18:41:24 CET 2024
On Wed, Dec 13, 2023 at 01:13:54PM +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
>
> It's totally valid for read() to provide less bytes than requested
> maximum. It may happen if there is no more data available yet or source
> pushes data in small chunks.
>
> This actually happens when trying to read env data from NVMEM device.
> Kernel may provide NVMEM content in page size parts (like 4096 B).
>
> This fixes warnings like:
> Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 16384 bytes but got 4096
> Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 12288 bytes but got 4096
> Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 8192 bytes but got 4096
>
> Since the main loop in flash_read_buf() is used to read blocks this
> patch adds a new nested one.
>
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
Applied to u-boot/next, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240106/17220c43/attachment.sig>
More information about the U-Boot
mailing list