linux-aspeed.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: aspeed - Fix dma_unmap_sg() direction
@ 2025-09-05 11:51 Thomas Fourier
  2025-09-10  6:58 ` Andrew Jeffery
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Fourier @ 2025-09-05 11:51 UTC (permalink / raw)
  Cc: Thomas Fourier, stable, Neal Liu, Herbert Xu, David S. Miller,
	Joel Stanley, Andrew Jeffery, Dhananjay Phadke, Johnny Huang,
	linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

It seems like everywhere in this file, when the request is not
bidirectional, req->src is mapped with DMA_TO_DEVICE and req->src is
mapped with DMA_FROM_DEVICE.

Fixes: 62f58b1637b7 ("crypto: aspeed - add HACE crypto driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@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);
 	}
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: aspeed - Fix dma_unmap_sg() direction
  2025-09-05 11:51 [PATCH] crypto: aspeed - Fix dma_unmap_sg() direction Thomas Fourier
@ 2025-09-10  6:58 ` Andrew Jeffery
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Jeffery @ 2025-09-10  6:58 UTC (permalink / raw)
  To: Thomas Fourier
  Cc: stable, Neal Liu, Herbert Xu, David S. Miller, Joel Stanley,
	Dhananjay Phadke, Johnny Huang, linux-aspeed, linux-crypto,
	linux-arm-kernel, linux-kernel

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@vger.kernel.org>
> Signed-off-by: Thomas Fourier <fourier.thomas@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);
>         }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-10  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:51 [PATCH] crypto: aspeed - Fix dma_unmap_sg() direction Thomas Fourier
2025-09-10  6:58 ` Andrew Jeffery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).