Commit 0a641712 authored by Joel Fernandes's avatar Joel Fernandes Committed by Herbert Xu

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: default avatarJoel Fernandes <joelf@ti.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4b645c94
...@@ -484,6 +484,8 @@ static int omap_aes_crypt_dma(struct crypto_tfm *tfm, ...@@ -484,6 +484,8 @@ static int omap_aes_crypt_dma(struct crypto_tfm *tfm,
struct dma_slave_config cfg; struct dma_slave_config cfg;
int ret; int ret;
dma_sync_sg_for_device(dd->dev, dd->in_sg, in_sg_len, DMA_TO_DEVICE);
memset(&cfg, 0, sizeof(cfg)); memset(&cfg, 0, sizeof(cfg));
cfg.src_addr = dd->phys_base + AES_REG_DATA_N(dd, 0); 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) ...@@ -670,6 +672,8 @@ static void omap_aes_done_task(unsigned long data)
pr_debug("enter done_task\n"); 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_crypt_dma_stop(dd);
omap_aes_finish_req(dd, 0); omap_aes_finish_req(dd, 0);
omap_aes_handle_queue(dd, NULL); omap_aes_handle_queue(dd, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment