All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] crypto: caam/qi - execute library only on DPAA 1.x
@ 2019-08-05 12:49 Horia Geantă
  2019-08-15 12:05 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Horia Geantă @ 2019-08-05 12:49 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, Aymen Sghaier, linux-crypto, NXP Linux Team

In the process of turning caam/qi into a library, the check of
MCFGR[QI] bit has been inadvertently dropped.
Fix the condition for DPAA 1.x QI detection, which should be:
MCFGR[QI] && !MCFGR[DPAA2]

A check in the library exit point is currently not needed,
since the list of registered algorithms is empty.

While here, silence the library initialization abort - since jr.c
calls it unconditionally.

Fixes: 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
v2: dropped check at library exit point

 drivers/crypto/caam/caamalg_qi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c
index 32f0f8a72067..d470724bcddf 100644
--- a/drivers/crypto/caam/caamalg_qi.c
+++ b/drivers/crypto/caam/caamalg_qi.c
@@ -2523,10 +2523,9 @@ int caam_qi_algapi_init(struct device *ctrldev)
 	unsigned int md_limit = SHA512_DIGEST_SIZE;
 	bool registered = false;
 
-	if (caam_dpaa2) {
-		dev_info(ctrldev, "caam/qi frontend driver not suitable for DPAA 2.x, aborting...\n");
-		return -ENODEV;
-	}
+	/* Make sure this runs only on (DPAA 1.x) QI */
+	if (!priv->qi_present || caam_dpaa2)
+		return 0;
 
 	/*
 	 * Register crypto algorithms the device supports.
-- 
2.17.1


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

* Re: [PATCH v2] crypto: caam/qi - execute library only on DPAA 1.x
  2019-08-05 12:49 [PATCH v2] crypto: caam/qi - execute library only on DPAA 1.x Horia Geantă
@ 2019-08-15 12:05 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2019-08-15 12:05 UTC (permalink / raw)
  To: Horia Geantă
  Cc: David S. Miller, Aymen Sghaier, linux-crypto, NXP Linux Team

On Mon, Aug 05, 2019 at 03:49:55PM +0300, Horia Geantă wrote:
> In the process of turning caam/qi into a library, the check of
> MCFGR[QI] bit has been inadvertently dropped.
> Fix the condition for DPAA 1.x QI detection, which should be:
> MCFGR[QI] && !MCFGR[DPAA2]
> 
> A check in the library exit point is currently not needed,
> since the list of registered algorithms is empty.
> 
> While here, silence the library initialization abort - since jr.c
> calls it unconditionally.
> 
> Fixes: 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries")
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
> ---
> v2: dropped check at library exit point
> 
>  drivers/crypto/caam/caamalg_qi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
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

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

end of thread, other threads:[~2019-08-15 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 12:49 [PATCH v2] crypto: caam/qi - execute library only on DPAA 1.x Horia Geantă
2019-08-15 12:05 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.