summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@freescale.com>2014-04-03 10:30:57 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-04-18 03:52:11 (GMT)
commit5833b1aa8d7bae2c265dc27554634b62b064e698 (patch)
tree47516544928512b7179eece7ac0421ea254e5775 /drivers/crypto/caam
parenta204f182819fde737aaac2f0d8aa3570e8f94266 (diff)
downloadlinux-fsl-qoriq-5833b1aa8d7bae2c265dc27554634b62b064e698.tar.xz
crypto: caam - fix condition for the jump over key(s) command
Only one DECO can access a given shared CHA, so waiting for CHAs to be done is not necessary when jumping the keys. SELF condition has no sense for the SERIAL sharing since the jobs are executed in the same DECO. Change-Id: I5501a9646a55913ca8a2f98dc246bf6ff2f08df0 Signed-off-by: Tudor Ambarus <tudor.ambarus@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/10814 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/crypto/caam')
-rw-r--r--drivers/crypto/caam/caamalg.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 17ea75f..6a89e1b 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -659,9 +659,8 @@ static int tls_set_sh_desc(struct crypto_aead *aead)
init_sh_desc(desc, HDR_SHARE_SERIAL | stidx);
/* skip key loading if they are loaded due to sharing */
- key_jump_cmd = append_jump(desc, JUMP_CLASS_BOTH | JUMP_JSL |
- JUMP_TEST_ALL | JUMP_COND_SHRD |
- JUMP_COND_SELF);
+ key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
+ JUMP_COND_SHRD);
if (keys_fit_inline) {
append_key_as_imm(desc, ctx->key, ctx->split_key_pad_len,
ctx->split_key_len, CLASS_2 |
@@ -761,9 +760,8 @@ static int tls_set_sh_desc(struct crypto_aead *aead)
init_sh_desc(desc, HDR_SHARE_SERIAL | stidx);
/* skip key loading if they are loaded due to sharing */
- key_jump_cmd = append_jump(desc, JUMP_CLASS_BOTH | JUMP_JSL |
- JUMP_TEST_ALL | JUMP_COND_SHRD |
- JUMP_COND_SELF);
+ key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
+ JUMP_COND_SHRD);
append_key(desc, ctx->key_dma, ctx->split_key_len, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
append_key(desc, ctx->key_dma + ctx->split_key_pad_len,
@@ -953,7 +951,7 @@ static int gcm_set_sh_desc(struct crypto_aead *aead)
/* skip key loading if they are loaded due to sharing */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
- JUMP_COND_SHRD | JUMP_COND_SELF);
+ JUMP_COND_SHRD);
if (keys_fit_inline)
append_key_as_imm(desc, (void *)ctx->key, ctx->enckeylen,
ctx->enckeylen, CLASS_1 | KEY_DEST_CLASS_REG);
@@ -1059,9 +1057,8 @@ static int gcm_set_sh_desc(struct crypto_aead *aead)
init_sh_desc(desc, HDR_SHARE_SERIAL);
/* skip key loading if they are loaded due to sharing */
- key_jump_cmd = append_jump(desc, JUMP_JSL |
- JUMP_TEST_ALL | JUMP_COND_SHRD |
- JUMP_COND_SELF);
+ key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
+ JUMP_COND_SHRD);
if (keys_fit_inline)
append_key_as_imm(desc, (void *)ctx->key, ctx->enckeylen,
ctx->enckeylen, CLASS_1 | KEY_DEST_CLASS_REG);