crypto: atmel-aes - correct usage of dma_sync_* API
authorLeilei Zhao <leilei.zhao@atmel.com>
Tue, 7 Apr 2015 09:45:11 +0000 (17:45 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 8 Apr 2015 14:20:05 +0000 (22:20 +0800)
The output buffer is used for CPU access, so
the API should be dma_sync_single_for_cpu which
makes the cache line invalid in order to reload
the value in memory.

Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-aes.c

index fb760664d28f25c614c4a226222eaf0e6d973ff2..0f9a9dc06a830f4eb5f9669ba26df7c2f0a95077 100644 (file)
@@ -627,7 +627,7 @@ static int atmel_aes_crypt_dma_stop(struct atmel_aes_dev *dd)
                        dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE);
                        dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE);
                } else {
-                       dma_sync_single_for_device(dd->dev, dd->dma_addr_out,
+                       dma_sync_single_for_cpu(dd->dev, dd->dma_addr_out,
                                dd->dma_size, DMA_FROM_DEVICE);
 
                        /* copy data */