diff options
author | Ruchika Gupta <ruchika.gupta@freescale.com> | 2013-10-25 12:01:01 +0530 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-10-30 12:02:57 +0800 |
commit | 313ea293e9c4d1eabcaddd2c0800f083b03c2a2e (patch) | |
tree | cd6e48a5aa2a1ea84895cbe1278c1318eece5cdb /drivers/crypto/caam/caamalg.c | |
parent | 0d289788247a4751b2dfa0a23960ac4de9450a94 (diff) | |
download | blackbird-op-linux-313ea293e9c4d1eabcaddd2c0800f083b03c2a2e.tar.gz blackbird-op-linux-313ea293e9c4d1eabcaddd2c0800f083b03c2a2e.zip |
crypto: caam - Add Platform driver for Job Ring
The SEC Job Rings are now available as individual devices.
This would enable sharing of job rings between kernel and
user space. Job Rings can now be dynamically bound/unbound
from kernel.
Changes are made in the following layers of CAAM Driver
1. Controller driver
- Does basic initialization of CAAM Block.
- Creates platform devices for Job Rings.
(Earlier the initialization of Job ring was done
by the controller driver)
2. JobRing Platform driver
- Manages the platform Job Ring devices created
by the controller driver
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Reviewed-by: Garg Vakul-B16394 <vakul@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/caamalg.c')
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 86a0d415b9a7..ad9781e646c0 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -2071,13 +2071,15 @@ static int caam_cra_init(struct crypto_tfm *tfm) container_of(alg, struct caam_crypto_alg, crypto_alg); struct caam_ctx *ctx = crypto_tfm_ctx(tfm); struct caam_drv_private *priv = dev_get_drvdata(caam_alg->ctrldev); + struct platform_device *pdev; int tgt_jr = atomic_inc_return(&priv->tfm_count); /* * distribute tfms across job rings to ensure in-order * crypto request processing per tfm */ - ctx->jrdev = priv->jrdev[(tgt_jr / 2) % priv->total_jobrs]; + pdev = priv->jrpdev[(tgt_jr / 2) % priv->total_jobrs]; + ctx->jrdev = &pdev->dev; /* copy descriptor header template value */ ctx->class1_alg_type = OP_TYPE_CLASS1_ALG | caam_alg->class1_alg_type; |