]> err.no Git - linux-2.6/commitdiff
Blackfin arch: dma_memcpy borken for > 64K
authorAubrey Li <aubrey.li@analog.com>
Mon, 21 May 2007 10:09:28 +0000 (18:09 +0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 21 May 2007 16:50:22 +0000 (09:50 -0700)
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/blackfin/kernel/bfin_dma_5xx.c

index 1c344acfd487adec434444d4f6eb74b8c53cfa1f..0ccb0dc3f833392e602767c1708883cf752c7589 100644 (file)
@@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
 }
 EXPORT_SYMBOL(get_dma_curr_ycount);
 
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)
 {
        int direction;  /* 1 - address decrease, 0 - address increase */
        int flag_align; /* 1 - address aligned,  0 - address unaligned */
@@ -734,6 +734,21 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 
        return dest;
 }
+
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+       size_t bulk;
+       size_t rest;
+       void * addr;
+
+       bulk = (size >> 16) << 16;
+       rest = size - bulk;
+       if (bulk)
+               _dma_memcpy(dest, src, bulk);
+       addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+       return addr;
+}
+
 EXPORT_SYMBOL(dma_memcpy);
 
 void *safe_dma_memcpy(void *dest, const void *src, size_t size)