From: Leilei Zhao Date: Tue, 7 Apr 2015 09:45:11 +0000 (+0800) Subject: crypto: atmel-aes - correct usage of dma_sync_* API X-Git-Tag: firefly_0821_release~176^2~1973^2~23 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9cd223239a79df3cc758ecabb8473ca91599021b;p=firefly-linux-kernel-4.4.55.git crypto: atmel-aes - correct usage of dma_sync_* API 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 Acked-by: Nicolas Ferre Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index fb760664d28f..0f9a9dc06a83 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -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 */