[PATCH] crypto: caam: use dma align for crypt tfm ctx

Gaurav Jain posted 1 patch 2 years, 6 months ago
crypto/crypto_engine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] crypto: caam: use dma align for crypt tfm ctx
Posted by Gaurav Jain 2 years, 6 months ago
enginectx is not set when use crypto_tfm_ctx.
fixing this by modifying to crypto_tfm_ctx_dma

Fixes: 4cb4f7c11dee ("crypto: caam - Set DMA alignment explicitly")
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
---
 crypto/crypto_engine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c
index 74fcc0897041..ea1f41cbefe3 100644
--- a/crypto/crypto_engine.c
+++ b/crypto/crypto_engine.c
@@ -145,7 +145,7 @@ static void crypto_pump_requests(struct crypto_engine *engine,
 		}
 	}
 
-	enginectx = crypto_tfm_ctx(async_req->tfm);
+	enginectx = crypto_tfm_ctx_dma(async_req->tfm);
 
 	if (enginectx->op.prepare_request) {
 		ret = enginectx->op.prepare_request(engine, async_req);
-- 
2.25.1
Re: [PATCH] crypto: caam: use dma align for crypt tfm ctx
Posted by Herbert Xu 2 years, 6 months ago
On Thu, Aug 03, 2023 at 03:59:01PM +0530, Gaurav Jain wrote:
> enginectx is not set when use crypto_tfm_ctx.
> fixing this by modifying to crypto_tfm_ctx_dma
> 
> Fixes: 4cb4f7c11dee ("crypto: caam - Set DMA alignment explicitly")
> Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
> ---
>  crypto/crypto_engine.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for catching this.  Unfortunately this fix will break other
drivers that do not use ctx_dma.

I'll try to fix by getting rid of enginectx.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt