[PATCH v7 09/26] spl: Set FAT bl_len to ARCH_DMA_MINALIGN

Simon Glass sjg at chromium.org
Thu Nov 9 02:15:29 CET 2023


On Wed, 8 Nov 2023 at 09:49, Sean Anderson <seanga2 at gmail.com> wrote:
>
> 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 at gmail.com>
> ---
>
> Changes in v7:
> - Split off from the removal of filename
>
>  common/spl/spl_blk_fs.c        |  3 ++-
>  common/spl/spl_fat.c           |  2 +-
>  common/spl/spl_fit.c           | 23 +----------------------
>  common/spl/spl_imx_container.c |  8 +++++---
>  4 files changed, 9 insertions(+), 27 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list