Skip to content

Commit

Permalink
arc: fix arc_dma_sync_sg_for_{cpu,device}
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed May 19, 2018
1 parent 713a746 commit b591741
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/arc/mm/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit b591741

Please sign in to comment.