[PATCH v6 09/25] spl: Remove filename from spl_load_info
Sean Anderson
seanga2 at gmail.com
Wed Nov 8 16:34:41 CET 2023
On 11/7/23 23:23, Simon Glass wrote:
> On Sun, 5 Nov 2023 at 19:26, Sean Anderson <seanga2 at gmail.com> wrote:
>>
>> For filesystems, filename serves the same purpose as priv. However,
>> spl_load_fit_image also uses it to determine whether to use a DMA-aligned
>> buffer. This is beneficial for FAT, which uses a bounce-buffer if the
>> destination is not DMA-aligned. Remove this logic, and instead achieve it
>> by setting bl_len to ARCH_DMA_MINALIGN. With this done, we can remove
>> filename entirely.
>>
>> One wrinkle bears mentioning: 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 v6:
>> - New
>>
>> arch/arm/mach-sunxi/spl_spi_sunxi.c | 1 -
>> common/spl/spl_blk_fs.c | 10 ++++++----
>> common/spl/spl_fat.c | 6 +++---
>> common/spl/spl_fit.c | 23 +----------------------
>> common/spl/spl_imx_container.c | 8 +++++---
>> common/spl/spl_mmc.c | 2 --
>> common/spl/spl_nand.c | 3 ---
>> common/spl/spl_semihosting.c | 1 -
>> common/spl/spl_spi.c | 2 --
>> common/spl/spl_ymodem.c | 1 -
>> include/spl.h | 2 --
>> test/image/spl_load_os.c | 1 -
>> 12 files changed, 15 insertions(+), 45 deletions(-)
>
> Er, I think
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> but I wonder if this patch could be split?
Into the filesystem bl_len stuff and the removal of filename? Yeah, probably.
--Sean
More information about the U-Boot
mailing list