diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2016-12-14 15:04:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 16:04:07 -0800 |
commit | 8c16a2e209d563a1909451c769417a6f953e5b2c (patch) | |
tree | a80bf7d32c3658df5b59e0e84b70871973600ae7 /arch/blackfin | |
parent | e8b4762c22589a514add9bf9dda7a3050e4fa54c (diff) | |
download | linux-stable-8c16a2e209d563a1909451c769417a6f953e5b2c.tar.gz linux-stable-8c16a2e209d563a1909451c769417a6f953e5b2c.tar.bz2 linux-stable-8c16a2e209d563a1909451c769417a6f953e5b2c.zip |
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.
Link: http://lkml.kernel.org/r/20161110113436.76501.13386.stgit@ahduyck-blue-test.jf.intel.com
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Steven Miao <realmz6@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/kernel/dma-mapping.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index 53fbbb61aa86..a27a74a18fb0 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -118,6 +118,10 @@ static int bfin_dma_map_sg(struct device *dev, struct scatterlist *sg_list, 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(struct device *dev, struct page *page, { 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; } |