Skip to content

Commit

Permalink
Blackfin arch: dma_memcpy borken for > 64K
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aubrey Li authored and Linus Torvalds committed May 21, 2007
1 parent 5079df9 commit 5f9a3e8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion arch/blackfin/kernel/bfin_dma_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5f9a3e8

Please sign in to comment.