crypto: caam: use dma align for crypt tfm ctx

Message ID 20230803102901.3116858-1-gaurav.jain@nxp.com
State New
Headers
Series crypto: caam: use dma align for crypt tfm ctx |

Commit Message

Gaurav Jain Aug. 3, 2023, 10:29 a.m. UTC
  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(-)
  

Comments

Herbert Xu Aug. 4, 2023, 4:35 a.m. UTC | #1
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,
  

Patch

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);