[PATCH] crypto: aspeed - Fix dma_unmap_sg() direction

Andrew Jeffery andrew at codeconstruct.com.au
Wed Sep 10 16:58:42 AEST 2025


On Fri, 2025-09-05 at 13:51 +0200, Thomas Fourier wrote:
> It seems like everywhere in this file, when the request is not
> bidirectional, req->src is mapped with DMA_TO_DEVICE 
> 

Okay, however:

> and req->src is
> mapped with DMA_FROM_DEVICE.

By the patch itself, one should refer to req->dst?

Andrew

> 
> Fixes: 62f58b1637b7 ("crypto: aspeed - add HACE crypto driver")
> Cc: <stable at vger.kernel.org>
> Signed-off-by: Thomas Fourier <fourier.thomas at gmail.com>
> ---
>  drivers/crypto/aspeed/aspeed-hace-crypto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/aspeed/aspeed-hace-crypto.c b/drivers/crypto/aspeed/aspeed-hace-crypto.c
> index a72dfebc53ff..fa201dae1f81 100644
> --- a/drivers/crypto/aspeed/aspeed-hace-crypto.c
> +++ b/drivers/crypto/aspeed/aspeed-hace-crypto.c
> @@ -346,7 +346,7 @@ static int aspeed_sk_start_sg(struct aspeed_hace_dev *hace_dev)
>  
>         } else {
>                 dma_unmap_sg(hace_dev->dev, req->dst, rctx->dst_nents,
> -                            DMA_TO_DEVICE);
> +                            DMA_FROM_DEVICE);
>                 dma_unmap_sg(hace_dev->dev, req->src, rctx->src_nents,
>                              DMA_TO_DEVICE);
>         }



More information about the Linux-aspeed mailing list