aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/dma-mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r--arch/arm/mm/dma-mapping.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 26325cb5d368..a316c9459526 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -573,8 +573,12 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
573 int i; 573 int i;
574 574
575 for_each_sg(sg, s, nents, i) { 575 for_each_sg(sg, s, nents, i) {
576 dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0, 576 if (!dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0,
577 sg_dma_len(s), dir); 577 sg_dma_len(s), dir))
578 continue;
579
580 __dma_page_dev_to_cpu(sg_page(s), s->offset,
581 s->length, dir);
578 } 582 }
579} 583}
580EXPORT_SYMBOL(dma_sync_sg_for_cpu); 584EXPORT_SYMBOL(dma_sync_sg_for_cpu);
@@ -597,9 +601,8 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
597 sg_dma_len(s), dir)) 601 sg_dma_len(s), dir))
598 continue; 602 continue;
599 603
600 if (!arch_is_coherent()) 604 __dma_page_cpu_to_dev(sg_page(s), s->offset,
601 dma_cache_maint_page(sg_page(s), s->offset, 605 s->length, dir);
602 s->length, dir);
603 } 606 }
604} 607}
605EXPORT_SYMBOL(dma_sync_sg_for_device); 608EXPORT_SYMBOL(dma_sync_sg_for_device);