summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/omap-aes.c
diff options
context:
space:
mode:
authorJoel Fernandes <joelf@ti.com>2013-08-18 04:42:26 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2013-08-21 13:28:00 +0200
commit0a641712ef9459df5d8c19fc19e686887257b3e3 (patch)
tree558f74b706a211d3a7768108c675783f8b29f870 /drivers/crypto/omap-aes.c
parentcrypto: omap-aes - Simplify DMA usage by using direct SGs (diff)
downloadlinux-0a641712ef9459df5d8c19fc19e686887257b3e3.tar.xz
linux-0a641712ef9459df5d8c19fc19e686887257b3e3.zip
crypto: omap-aes - Sync SG before DMA operation
Earlier functions that did a similar sync are replaced by the dma_sync_sg_* which can operate on entire SG list. Signed-off-by: Joel Fernandes <joelf@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/omap-aes.c')
-rw-r--r--drivers/crypto/omap-aes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 114c55a59efe..4ed2a8c40394 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -484,6 +484,8 @@ static int omap_aes_crypt_dma(struct crypto_tfm *tfm,
struct dma_slave_config cfg;
int ret;
+ dma_sync_sg_for_device(dd->dev, dd->in_sg, in_sg_len, DMA_TO_DEVICE);
+
memset(&cfg, 0, sizeof(cfg));
cfg.src_addr = dd->phys_base + AES_REG_DATA_N(dd, 0);
@@ -670,6 +672,8 @@ static void omap_aes_done_task(unsigned long data)
pr_debug("enter done_task\n");
+ dma_sync_sg_for_cpu(dd->dev, dd->in_sg, dd->in_sg_len, DMA_FROM_DEVICE);
+
omap_aes_crypt_dma_stop(dd);
omap_aes_finish_req(dd, 0);
omap_aes_handle_queue(dd, NULL);