summaryrefslogtreecommitdiffstats
path: root/arch/nds32
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-19 09:22:05 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-29 16:10:27 +0200
commitf860122c512215df598fc5b5cfe36e35335f6c6f (patch)
treed63071802f68759339eb2afb3d03da8089945e17 /arch/nds32
parent4ac1c68e360653cad34488a5a1915d55f7c3fa86 (diff)
downloadlinux-f860122c512215df598fc5b5cfe36e35335f6c6f.tar.bz2
nds32: implement the unmap_sg DMA operation
This matches the implementation of the more commonly used unmap_single routines and the sync_sg_for_cpu method which should provide equivalent cache maintainance. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Greentime Hu <greentime@andestech.com> Tested-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32')
-rw-r--r--arch/nds32/kernel/dma.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/nds32/kernel/dma.c b/arch/nds32/kernel/dma.c
index e0c94a2889c5..b9973317c734 100644
--- a/arch/nds32/kernel/dma.c
+++ b/arch/nds32/kernel/dma.c
@@ -458,6 +458,12 @@ static void nds32_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
int nhwentries, enum dma_data_direction dir,
unsigned long attrs)
{
+ int i;
+
+ for (i = 0; i < nhwentries; i++, sg++) {
+ nds32_dma_sync_single_for_cpu(dev, sg_dma_address(sg),
+ sg->length, dir);
+ }
}
struct dma_map_ops nds32_dma_ops = {