diff mbox

crypto: caam/qi - abort algorithm setup on DPAA2 parts

Message ID 20171024062731.28070-2-horia.geanta@nxp.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Horia Geanta Oct. 24, 2017, 6:27 a.m. UTC
caam/qi frontend (i.e. caamalg_qi) mustn't be used in case it runs on a
DPAA2 part (this could happen when using a multiplatform kernel).

Fixes: 297b9cebd2fc ("crypto: caam/jr - add support for DPAA2 parts")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
If this patch won't make it into v4.14 (likely the case),
eventually it should be sent to -stable.

 drivers/crypto/caam/caamalg_qi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Herbert Xu Nov. 3, 2017, 2:27 p.m. UTC | #1
On Tue, Oct 24, 2017 at 09:27:31AM +0300, Horia Geantă wrote:
> caam/qi frontend (i.e. caamalg_qi) mustn't be used in case it runs on a
> DPAA2 part (this could happen when using a multiplatform kernel).
> 
> Fixes: 297b9cebd2fc ("crypto: caam/jr - add support for DPAA2 parts")
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c
index 2eefc4a26bc2..f9f08fce4356 100644
--- a/drivers/crypto/caam/caamalg_qi.c
+++ b/drivers/crypto/caam/caamalg_qi.c
@@ -7,7 +7,7 @@ 
  */
 
 #include "compat.h"
-
+#include "ctrl.h"
 #include "regs.h"
 #include "intern.h"
 #include "desc_constr.h"
@@ -2312,6 +2312,11 @@  static int __init caam_qi_algapi_init(void)
 	if (!priv || !priv->qi_present)
 		return -ENODEV;
 
+	if (caam_dpaa2) {
+		dev_info(ctrldev, "caam/qi frontend driver not suitable for DPAA 2.x, aborting...\n");
+		return -ENODEV;
+	}
+
 	INIT_LIST_HEAD(&alg_list);
 
 	/*