Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101738
b: refs/heads/master
c: 03d7061
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Lewis authored and Paul Mackerras committed Jul 1, 2008
1 parent 8c8973d commit 027a514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d4ae9fc92f347b93b42c9c0ccde7138c1202e36
refs/heads/master: 03d70617b8a789c3721afaafde06fcbba7c7ebf1
11 changes: 9 additions & 2 deletions trunk/arch/powerpc/lib/dma-noncoherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,15 @@ void __dma_sync(void *vaddr, size_t size, int direction)
switch (direction) {
case DMA_NONE:
BUG();
case DMA_FROM_DEVICE: /* invalidate only */
invalidate_dcache_range(start, end);
case DMA_FROM_DEVICE:
/*
* invalidate only when cache-line aligned otherwise there is
* the potential for discarding uncommitted data from the cache
*/
if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
flush_dcache_range(start, end);
else
invalidate_dcache_range(start, end);
break;
case DMA_TO_DEVICE: /* writeback only */
clean_dcache_range(start, end);
Expand Down

0 comments on commit 027a514

Please sign in to comment.