arc: fix arc_dma_sync_sg_for_{cpu,device}
authorChristoph Hellwig <hch@lst.de>
Fri, 18 May 2018 13:16:45 +0000 (15:16 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 19 May 2018 06:46:12 +0000 (08:46 +0200)
These functions should perform the same functionality as calling
arc_dma_sync_single_for_{cpu,device} on each S/G list element.  Ensure
they actually do that by calling arc_dma_sync_single_for_{cpu,device}.
Otherwise we could be passing a different dir argument.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/mm/dma.c

index 98e21ce526be5f4e3f373d3e8b8ee0a4b66963cc..eafdbd2ad20a41ef3656ec24034b2abd0b9f04c3 100644 (file)
@@ -241,7 +241,7 @@ static void arc_dma_sync_sg_for_cpu(struct device *dev,
        struct scatterlist *sg;
 
        for_each_sg(sglist, sg, nelems, i)
-               _dma_cache_sync(sg_phys(sg), sg->length, dir);
+               arc_dma_sync_single_for_cpu(dev, sg_phys(sg), sg->length, dir);
 }
 
 static void arc_dma_sync_sg_for_device(struct device *dev,
@@ -252,7 +252,8 @@ static void arc_dma_sync_sg_for_device(struct device *dev,
        struct scatterlist *sg;
 
        for_each_sg(sglist, sg, nelems, i)
-               _dma_cache_sync(sg_phys(sg), sg->length, dir);
+               arc_dma_sync_single_for_device(dev, sg_phys(sg), sg->length,
+                               dir);
 }
 
 static int arc_dma_supported(struct device *dev, u64 dma_mask)