[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161024120458.16276.10950.stgit@ahduyck-blue-test.jf.intel.com>
Date: Mon, 24 Oct 2016 08:04:58 -0400
From: Alexander Duyck <alexander.h.duyck@...el.com>
To: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: brouer@...hat.com, davem@...emloft.net,
Steven Miao <realmz6@...il.com>
Subject: [net-next PATCH RFC 06/26] 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.
Cc: Steven Miao <realmz6@...il.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@...el.com>
---
arch/blackfin/kernel/dma-mapping.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c
index 53fbbb6..ed9a6a8 100644
--- a/arch/blackfin/kernel/dma-mapping.c
+++ b/arch/blackfin/kernel/dma-mapping.c
@@ -133,6 +133,10 @@ static void bfin_dma_sync_sg_for_device(struct device *dev,
for_each_sg(sg_list, sg, nelems, 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,8 @@ 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;
}
Powered by blists - more mailing lists