]> git.dujemihanovic.xyz Git - u-boot.git/commit
spl: Set FAT bl_len to ARCH_DMA_MINALIGN
authorSean Anderson <seanga2@gmail.com>
Wed, 8 Nov 2023 16:48:41 +0000 (11:48 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 16 Nov 2023 18:49:14 +0000 (13:49 -0500)
commitb63664be6a3d829639f8635365f22f4e1dd30aa1
treea4a3558370c7be43bc58f60aecad0036d32fe42c
parent73c40fcb7367f5a431c987f7da0420c058a939fc
spl: Set FAT bl_len to ARCH_DMA_MINALIGN

Instead of relying on the presence of filename to determine whether we are
dealing with a FAT filesystem (and should DMA-align the buffer), have FAT set
bl_len to ARCH_DMA_MINALIGN instead. With this done, we can remove the
special-case logic checking for the presence of filename.

Because filesystems are not block-based, we may read less than the size passed
to spl_load_info.read. This can happen if the file size is not DMA-aligned. This
is fine as long as we read the amount we originally wanted to. Modify the
conditions for callers of spl_load_info.read to check against the original,
unaligned size to avoid failing spuriously.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/spl/spl_blk_fs.c
common/spl/spl_fat.c
common/spl/spl_fit.c
common/spl/spl_imx_container.c