diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-31 16:52:16 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-15 15:21:43 +0000 |
commit | 18eabe2347ae7a11b3db768695913724166dfb0e (patch) | |
tree | 2f6a9bb654d01e07a62be75adc1282e97b5c16d4 /arch/arm/common | |
parent | bf32eb85492af197ea5ff20e0be56f667a80584d (diff) | |
download | op-kernel-dev-18eabe2347ae7a11b3db768695913724166dfb0e.zip op-kernel-dev-18eabe2347ae7a11b3db768695913724166dfb0e.tar.gz |
ARM: dma-mapping: introduce the idea of buffer ownership
The DMA API has the notion of buffer ownership; make it explicit in the
ARM implementation of this API. This gives us a set of hooks to allow
us to deal with CPU cache issues arising from non-cache coherent DMA.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-By: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-By: Jamie Iles <jamie@jamieiles.com>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/dmabounce.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index bc90364..51499d6 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c @@ -277,7 +277,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size, * We don't need to sync the DMA buffer since * it was allocated via the coherent allocators. */ - dma_cache_maint(ptr, size, dir); + __dma_single_cpu_to_dev(ptr, size, dir); } return dma_addr; @@ -315,6 +315,8 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr, __cpuc_flush_kernel_dcache_area(ptr, size); } free_safe_buffer(dev->archdata.dmabounce, buf); + } else { + __dma_single_dev_to_cpu(dma_to_virt(dev, dma_addr), size, dir); } } |