summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam/caamrng.c
diff options
context:
space:
mode:
authorVictoria Milhoan <vicki.milhoan@freescale.com>2015-08-05 11:28:35 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2015-08-10 23:18:55 +0800
commite7472422392461f59bc5d7ddd8542c6a48740336 (patch)
tree778c4747bed011ecd99592dc5068cd8b20673a4f /drivers/crypto/caam/caamrng.c
parentbf20d772174bbb6b1a7c0b34f04f51caebe2d6aa (diff)
crypto: caam - Add cache coherency support
Freescale i.MX6 ARM platforms do not support hardware cache coherency. This patch adds cache coherency support to the CAAM driver. Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com> Tested-by: Horia Geantă <horia.geanta@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/caamrng.c')
-rw-r--r--drivers/crypto/caam/caamrng.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 5095337205b8..a1d21d5fb2ff 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -108,6 +108,10 @@ static void rng_done(struct device *jrdev, u32 *desc, u32 err, void *context)
atomic_set(&bd->empty, BUF_NOT_EMPTY);
complete(&bd->filled);
+
+ /* Buffer refilled, invalidate cache */
+ dma_sync_single_for_cpu(jrdev, bd->addr, RN_BUF_SIZE, DMA_FROM_DEVICE);
+
#ifdef DEBUG
print_hex_dump(KERN_ERR, "rng refreshed buf@: ",
DUMP_PREFIX_ADDRESS, 16, 4, bd->buf, RN_BUF_SIZE, 1);