Skip to contentSkip to conversation

arch/blackfin: add option to skip sync on DMA map

PATCH New [email protected] 1 participant 1 message Dec 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 13/114 arch/blackfin: add option to skip sync on DMA map

From: Alexander Duyck <[email protected]>
Subject: arch/blackfin: add option to skip sync on DMA map

The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior.

---

 arch/blackfin/kernel/dma-mapping.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/blackfin/kernel/dma-mapping.c renamed from arch/blackfin/kernel/dma-mapping.c~arch-blackfin-add-option-to-skip-sync-on-dma-map +7 -1
diff -puN arch/blackfin/kernel/dma-mapping.c~arch-blackfin-add-option-to-skip-sync-on-dma-map arch/blackfin/kernel/dma-mapping.c
@@ -118,6 +118,10 @@ static int bfin_dma_map_sg(struct device
 
 	for_each_sg(sg_list, sg, nents, i) {
 		sg->dma_address = (dma_addr_t) sg_virt(sg);
+
+		if (attrs & DMA_ATTR_SKIP_CPU_SYNC)
+			continue;
+
 		__dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction);
 	}
 
@@ -143,7 +147,9 @@ static dma_addr_t bfin_dma_map_page(stru
 {
 	dma_addr_t handle = (dma_addr_t)(page_address(page) + offset);
 
-	_dma_sync(handle, size, dir);
+	if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
+		_dma_sync(handle, size, dir);
+
 	return handle;
 }
 

_