]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00215228-13: Add cache coherence to externalized key generation
authorSteve Cornelius <steve.cornelius@freescale.com>
Thu, 28 Jun 2012 22:39:18 +0000 (15:39 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:54 +0000 (08:34 +0200)
Add cache coherence to externalized key generation

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
drivers/crypto/caam/key_gen.c

index 8e8a1d71ded670ff618dc44d6a62a5f6c7bfaffe..8e67628b3c1bf59b1306ec44883defa4fa8387eb 100644 (file)
@@ -64,6 +64,7 @@ u32 gen_split_key(struct device *jrdev, u8 *key_out, int split_key_len,
                kfree(desc);
                return -ENOMEM;
        }
+       dma_sync_single_for_device(jrdev, dma_addr_in, keylen, DMA_TO_DEVICE);
        append_key(desc, dma_addr_in, keylen, CLASS_2 | KEY_DEST_CLASS_REG);
 
        /* Sets MDHA up into an HMAC-INIT */
@@ -111,7 +112,8 @@ u32 gen_split_key(struct device *jrdev, u8 *key_out, int split_key_len,
                               split_key_pad_len, 1);
 #endif
        }
-
+       dma_sync_single_for_cpu(jrdev, dma_addr_out, split_key_pad_len,
+                               DMA_FROM_DEVICE);
        dma_unmap_single(jrdev, dma_addr_out, split_key_pad_len,
                         DMA_FROM_DEVICE);
        dma_unmap_single(jrdev, dma_addr_in, keylen, DMA_TO_DEVICE);