635ab0037e4d150022624eaed1b7f3096e10dcb3
[openwrt/openwrt.git] / target / linux / apm821xx / patches-4.14 / 023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch
1 From 67d8208fba1324fa0198f9fc58a9edbe09596947 Mon Sep 17 00:00:00 2001
2 From: Christoph Hellwig <hch@lst.de>
3 Date: Sun, 16 Dec 2018 18:19:46 +0100
4 Subject: [PATCH 04/15] crypto4xx_core: don't abuse __dma_sync_page
5
6 This function is internal to the DMA API implementation. Instead use
7 the DMA API to properly unmap. Note that the DMA API usage in this
8 driver is a disaster and urgently needs some work - it is missing all
9 the unmaps, seems to do a secondary map where it looks like it should
10 to a unmap in one place to work around cache coherency and the
11 directions passed in seem to be partially wrong.
12
13 Signed-off-by: Christoph Hellwig <hch@lst.de>
14 Tested-by: Christian Lamparter <chunkeey@gmail.com>
15 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
16 ---
17 drivers/crypto/amcc/crypto4xx_core.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 --- a/drivers/crypto/amcc/crypto4xx_core.c
21 +++ b/drivers/crypto/amcc/crypto4xx_core.c
22 @@ -596,7 +596,7 @@ static void crypto4xx_aead_done(struct c
23 pd->pd_ctl_len.bf.pkt_len,
24 dst);
25 } else {
26 - __dma_sync_page(sg_page(dst), dst->offset, dst->length,
27 + dma_unmap_page(dev->core_dev->device, pd->dest, dst->length,
28 DMA_FROM_DEVICE);
29 }
30