diff options
Diffstat (limited to 'arch/blackfin/kernel/bfin_dma_5xx.c')
-rw-r--r-- | arch/blackfin/kernel/bfin_dma_5xx.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c index 26403d1c9e65..1e485dfdc9f2 100644 --- a/arch/blackfin/kernel/bfin_dma_5xx.c +++ b/arch/blackfin/kernel/bfin_dma_5xx.c @@ -450,7 +450,6 @@ void *dma_memcpy(void *pdst, const void *psrc, size_t size) { unsigned long dst = (unsigned long)pdst; unsigned long src = (unsigned long)psrc; - size_t bulk, rest; if (bfin_addr_dcacheable(src)) blackfin_dcache_flush_range(src, src + size); @@ -458,6 +457,22 @@ void *dma_memcpy(void *pdst, const void *psrc, size_t size) if (bfin_addr_dcacheable(dst)) blackfin_dcache_invalidate_range(dst, dst + size); + return dma_memcpy_nocache(pdst, psrc, size); +} +EXPORT_SYMBOL(dma_memcpy); + +/** + * dma_memcpy_nocache - DMA memcpy under mutex lock + * - No cache flush/invalidate + * + * Do not check arguments before starting the DMA memcpy. Break the transfer + * up into two pieces. The first transfer is in multiples of 64k and the + * second transfer is the piece smaller than 64k. + */ +void *dma_memcpy_nocache(void *pdst, const void *psrc, size_t size) +{ + size_t bulk, rest; + bulk = size & ~0xffff; rest = size - bulk; if (bulk) @@ -465,7 +480,7 @@ void *dma_memcpy(void *pdst, const void *psrc, size_t size) _dma_memcpy(pdst + bulk, psrc + bulk, rest); return pdst; } -EXPORT_SYMBOL(dma_memcpy); +EXPORT_SYMBOL(dma_memcpy_nocache); /** * safe_dma_memcpy - DMA memcpy w/argument checking |