crypto: caam - fix polarity of "propagate error" logic
authorKim Phillips <kim.phillips@freescale.com>
Mon, 12 Dec 2011 20:59:15 +0000 (14:59 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Dec 2011 07:20:04 +0000 (15:20 +0800)
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>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/desc.h
drivers/crypto/caam/desc_constr.h

index a5bc706f57bf70ad22053f0170b663913b63c127..e73cf2e8110ae944302608ce864bd7b9d71a8422 100644 (file)
@@ -113,7 +113,7 @@ static inline void append_dec_shr_done(u32 *desc)
 
        jump_cmd = append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TEST_ALL);
        set_jump_tgt_here(desc, jump_cmd);
-       append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD);
+       append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
 }
 
 /*
@@ -213,7 +213,7 @@ static void init_sh_desc_key_aead(u32 *desc, struct caam_ctx *ctx,
        set_jump_tgt_here(desc, key_jump_cmd);
 
        /* Propagate errors from shared to job descriptor */
-       append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD);
+       append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
 }
 
 static int aead_set_sh_desc(struct crypto_aead *aead)
@@ -310,7 +310,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead)
        /* Only propagate error immediately if shared */
        jump_cmd = append_jump(desc, JUMP_TEST_ALL);
        set_jump_tgt_here(desc, key_jump_cmd);
-       append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD);
+       append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
        set_jump_tgt_here(desc, jump_cmd);
 
        /* Class 2 operation */
@@ -683,7 +683,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
        set_jump_tgt_here(desc, key_jump_cmd);
 
        /* Propagate errors from shared to job descriptor */
-       append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD);
+       append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
 
        /* Load iv */
        append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT |
@@ -724,7 +724,7 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
        /* For aead, only propagate error immediately if shared */
        jump_cmd = append_jump(desc, JUMP_TEST_ALL);
        set_jump_tgt_here(desc, key_jump_cmd);
-       append_cmd(desc, SET_OK_PROP_ERRORS | CMD_LOAD);
+       append_cmd(desc, SET_OK_NO_PROP_ERRORS | CMD_LOAD);
        set_jump_tgt_here(desc, jump_cmd);
 
        /* load IV */
index 6984cc5649323f1a215bfb28f32c0d707842b069..a17c2958dab1eed5c2cd3d7a5a715085ce39f398 100644 (file)
 #define LDOFF_CHG_SHARE_SHIFT          0
 #define LDOFF_CHG_SHARE_MASK           (0x3 << LDOFF_CHG_SHARE_SHIFT)
 #define LDOFF_CHG_SHARE_NEVER          (0x1 << LDOFF_CHG_SHARE_SHIFT)
-#define LDOFF_CHG_SHARE_OK_NO_PROP     (0x2 << LDOFF_CHG_SHARE_SHIFT)
-#define LDOFF_CHG_SHARE_OK_PROP                (0x3 << LDOFF_CHG_SHARE_SHIFT)
+#define LDOFF_CHG_SHARE_OK_PROP                (0x2 << LDOFF_CHG_SHARE_SHIFT)
+#define LDOFF_CHG_SHARE_OK_NO_PROP     (0x3 << LDOFF_CHG_SHARE_SHIFT)
 
 #define LDOFF_ENABLE_AUTO_NFIFO                (1 << 2)
 #define LDOFF_DISABLE_AUTO_NFIFO       (1 << 3)
index 0991323cf3fd40bd7e9f09f2e9c522aa78be3dfb..348b882275f059ede78df5d3ecf82b447c8e847e 100644 (file)
 #define PRINT_POS
 #endif
 
-#define SET_OK_PROP_ERRORS (IMMEDIATE | LDST_CLASS_DECO | \
-                           LDST_SRCDST_WORD_DECOCTRL | \
-                           (LDOFF_CHG_SHARE_OK_PROP << LDST_OFFSET_SHIFT))
+#define SET_OK_NO_PROP_ERRORS (IMMEDIATE | LDST_CLASS_DECO | \
+                              LDST_SRCDST_WORD_DECOCTRL | \
+                              (LDOFF_CHG_SHARE_OK_NO_PROP << \
+                               LDST_OFFSET_SHIFT))
 #define DISABLE_AUTO_INFO_FIFO (IMMEDIATE | LDST_CLASS_DECO | \
                                LDST_SRCDST_WORD_DECOCTRL | \
                                (LDOFF_DISABLE_AUTO_NFIFO << LDST_OFFSET_SHIFT))