Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5917410 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

arc: fix arc_dma_sync_sg_for_{cpu,device}



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: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
Acked-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 713a7462
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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)