aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/consistent.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/consistent.c')
-rw-r--r--arch/arm/mm/consistent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 6a9c362fef5e..83bd035c7d5e 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -208,6 +208,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
208 unsigned long kaddr = (unsigned long)page_address(page); 208 unsigned long kaddr = (unsigned long)page_address(page);
209 memset(page_address(page), 0, size); 209 memset(page_address(page), 0, size);
210 dmac_flush_range(kaddr, kaddr + size); 210 dmac_flush_range(kaddr, kaddr + size);
211 outer_flush_range(__pa(kaddr), __pa(kaddr) + size);
211 } 212 }
212 213
213 /* 214 /*
@@ -485,15 +486,20 @@ void consistent_sync(void *vaddr, size_t size, int direction)
485 unsigned long start = (unsigned long)vaddr; 486 unsigned long start = (unsigned long)vaddr;
486 unsigned long end = start + size; 487 unsigned long end = start + size;
487 488
489 BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end));
490
488 switch (direction) { 491 switch (direction) {
489 case DMA_FROM_DEVICE: /* invalidate only */ 492 case DMA_FROM_DEVICE: /* invalidate only */
490 dmac_inv_range(start, end); 493 dmac_inv_range(start, end);
494 outer_inv_range(__pa(start), __pa(end));
491 break; 495 break;
492 case DMA_TO_DEVICE: /* writeback only */ 496 case DMA_TO_DEVICE: /* writeback only */
493 dmac_clean_range(start, end); 497 dmac_clean_range(start, end);
498 outer_clean_range(__pa(start), __pa(end));
494 break; 499 break;
495 case DMA_BIDIRECTIONAL: /* writeback and invalidate */ 500 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
496 dmac_flush_range(start, end); 501 dmac_flush_range(start, end);
502 outer_flush_range(__pa(start), __pa(end));
497 break; 503 break;
498 default: 504 default:
499 BUG(); 505 BUG();