diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2011-12-12 15:59:15 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-12-20 02:20:04 -0500 |
commit | a2ecb155a30fea933cc539fc2064fef825fd9511 (patch) | |
tree | ecb4517d5ab2e89fbc73f4df477e605907601676 | |
parent | b028b546a6a36aa70ec504c00d3d94fae32acf86 (diff) |
crypto: caam - fix polarity of "propagate error" logic
the polarity of the definition for error propagation was reverse
in the initial desc.h. Fix desc.h and its users.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 10 | ||||
-rw-r--r-- | drivers/crypto/caam/desc.h | 4 | ||||
-rw-r--r-- | drivers/crypto/caam/desc_constr.h | 7 |
3 files changed, 11 insertions, 10 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index a5bc706f57bf..e73cf2e8110a 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -113,7 +113,7 @@ static inline void append_dec_shr_done(u32 *desc) | |||
113 | 113 | ||
114 | jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TEST_ALL); | 114 | jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TEST_ALL); |
115 | set_jump_tgt_here(desc, jump_cmd); | 115 | set_jump_tgt_here(desc, jump_cmd); |
116 | append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD); | 116 | append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); |
117 | } | 117 | } |
118 | 118 | ||
119 | /* | 119 | /* |
@@ -213,7 +213,7 @@ static void init_sh_desc_key_aead(u32 *desc, struct caam_ctx *ctx, | |||
213 | set_jump_tgt_here(desc, key_jump_cmd); | 213 | set_jump_tgt_here(desc, key_jump_cmd); |
214 | 214 | ||
215 | /* Propagate errors from shared to job descriptor */ | 215 | /* Propagate errors from shared to job descriptor */ |
216 | append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD); | 216 | append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); |
217 | } | 217 | } |
218 | 218 | ||
219 | static int aead_set_sh_desc(struct crypto_aead *aead) | 219 | static int aead_set_sh_desc(struct crypto_aead *aead) |
@@ -310,7 +310,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead) | |||
310 | /* Only propagate error immediately if shared */ | 310 | /* Only propagate error immediately if shared */ |
311 | jump_cmd = append_jump(desc, JUMP_TEST_ALL); | 311 | jump_cmd = append_jump(desc, JUMP_TEST_ALL); |
312 | set_jump_tgt_here(desc, key_jump_cmd); | 312 | set_jump_tgt_here(desc, key_jump_cmd); |
313 | append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD); | 313 | append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); |
314 | set_jump_tgt_here(desc, jump_cmd); | 314 | set_jump_tgt_here(desc, jump_cmd); |
315 | 315 | ||
316 | /* Class 2 operation */ | 316 | /* Class 2 operation */ |
@@ -683,7 +683,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, | |||
683 | set_jump_tgt_here(desc, key_jump_cmd); | 683 | set_jump_tgt_here(desc, key_jump_cmd); |
684 | 684 | ||
685 | /* Propagate errors from shared to job descriptor */ | 685 | /* Propagate errors from shared to job descriptor */ |
686 | append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD); | 686 | append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); |
687 | 687 | ||
688 | /* Load iv */ | 688 | /* Load iv */ |
689 | append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | | 689 | append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | |
@@ -724,7 +724,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, | |||
724 | /* For aead, only propagate error immediately if shared */ | 724 | /* For aead, only propagate error immediately if shared */ |
725 | jump_cmd = append_jump(desc, JUMP_TEST_ALL); | 725 | jump_cmd = append_jump(desc, JUMP_TEST_ALL); |
726 | set_jump_tgt_here(desc, key_jump_cmd); | 726 | set_jump_tgt_here(desc, key_jump_cmd); |
727 | append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD); | 727 | append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD); |
728 | set_jump_tgt_here(desc, jump_cmd); | 728 | set_jump_tgt_here(desc, jump_cmd); |
729 | 729 | ||
730 | /* load IV */ | 730 | /* load IV */ |
diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index 6984cc564932..a17c2958dab1 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h | |||
@@ -233,8 +233,8 @@ | |||
233 | #define LDOFF_CHG_SHARE_SHIFT 0 | 233 | #define LDOFF_CHG_SHARE_SHIFT 0 |
234 | #define LDOFF_CHG_SHARE_MASK (0x3 << LDOFF_CHG_SHARE_SHIFT) | 234 | #define LDOFF_CHG_SHARE_MASK (0x3 << LDOFF_CHG_SHARE_SHIFT) |
235 | #define LDOFF_CHG_SHARE_NEVER (0x1 << LDOFF_CHG_SHARE_SHIFT) | 235 | #define LDOFF_CHG_SHARE_NEVER (0x1 << LDOFF_CHG_SHARE_SHIFT) |
236 | #define LDOFF_CHG_SHARE_OK_NO_PROP (0x2 << LDOFF_CHG_SHARE_SHIFT) | 236 | #define LDOFF_CHG_SHARE_OK_PROP (0x2 << LDOFF_CHG_SHARE_SHIFT) |
237 | #define LDOFF_CHG_SHARE_OK_PROP (0x3 << LDOFF_CHG_SHARE_SHIFT) | 237 | #define LDOFF_CHG_SHARE_OK_NO_PROP (0x3 << LDOFF_CHG_SHARE_SHIFT) |
238 | 238 | ||
239 | #define LDOFF_ENABLE_AUTO_NFIFO (1 << 2) | 239 | #define LDOFF_ENABLE_AUTO_NFIFO (1 << 2) |
240 | #define LDOFF_DISABLE_AUTO_NFIFO (1 << 3) | 240 | #define LDOFF_DISABLE_AUTO_NFIFO (1 << 3) |
diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index 0991323cf3fd..348b882275f0 100644 --- a/drivers/crypto/caam/desc_constr.h +++ b/drivers/crypto/caam/desc_constr.h | |||
@@ -18,9 +18,10 @@ | |||
18 | #define PRINT_POS | 18 | #define PRINT_POS |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #define SET_OK_PROP_ERRORS (IMMEDIATE | LDST_CLASS_DECO | \ | 21 | #define SET_OK_NO_PROP_ERRORS (IMMEDIATE | LDST_CLASS_DECO | \ |
22 | LDST_SRCDST_WORD_DECOCTRL | \ | 22 | LDST_SRCDST_WORD_DECOCTRL | \ |
23 | (LDOFF_CHG_SHARE_OK_PROP << LDST_OFFSET_SHIFT)) | 23 | (LDOFF_CHG_SHARE_OK_NO_PROP << \ |
24 | LDST_OFFSET_SHIFT)) | ||
24 | #define DISABLE_AUTO_INFO_FIFO (IMMEDIATE | LDST_CLASS_DECO | \ | 25 | #define DISABLE_AUTO_INFO_FIFO (IMMEDIATE | LDST_CLASS_DECO | \ |
25 | LDST_SRCDST_WORD_DECOCTRL | \ | 26 | LDST_SRCDST_WORD_DECOCTRL | \ |
26 | (LDOFF_DISABLE_AUTO_NFIFO << LDST_OFFSET_SHIFT)) | 27 | (LDOFF_DISABLE_AUTO_NFIFO << LDST_OFFSET_SHIFT)) |