mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
arm64: dma-mapping: conditional skip map_sg by attrs
Add if statement(DMA_ATTR_SKIP_CPU_SYNC) for __swiotlb_map_sg_attrs to skip invalidating each sg element Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
@@ -224,10 +224,11 @@ static int __swiotlb_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
|
||||
int i, ret;
|
||||
|
||||
ret = swiotlb_map_sg_attrs(dev, sgl, nelems, dir, attrs);
|
||||
for_each_sg(sgl, sg, ret, i)
|
||||
__dma_map_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)),
|
||||
sg->length, dir);
|
||||
|
||||
if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) {
|
||||
for_each_sg(sgl, sg, ret, i)
|
||||
__dma_map_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)),
|
||||
sg->length, dir);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user