Re: [PATCH] crypto: sl3516 - drop invalid sg_dma_len checks before DMA mapping
From: Linus Walleij
Date: Fri Jul 10 2026 - 06:24:23 EST
On Fri, Jul 10, 2026 at 9:42 AM Thorsten Blum <thorsten.blum@xxxxxxxxx> wrote:
> sg_dma_len() is only valid after mapping the scatterlist with
> dma_map_sg(). However, sl3516_ce_need_fallback() checks it before the
> source and destination scatterlists are mapped. Thus, a stale DMA length
> that is not a multiple of 16 could incorrectly force a software fallback
> when CONFIG_NEED_SG_DMA_LENGTH=y.
>
> Remove the invalid checks; the existing scatterlist length checks are
> sufficient.
>
> Fixes: 46c5338db7bd ("crypto: sl3516 - Add sl3516 crypto engine")
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
Looks right to me.
Acked-by: Linus Walleij <linusw@xxxxxxxxxx>
Yours,
Linus Walleij