aboutsummaryrefslogtreecommitdiff
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 6a9c362fef5..83bd035c7d5 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,
unsigned long kaddr = (unsigned long)page_address(page);
memset(page_address(page), 0, size);
dmac_flush_range(kaddr, kaddr + size);
+ outer_flush_range(__pa(kaddr), __pa(kaddr) + size);
}
/*
@@ -485,15 +486,20 @@ void consistent_sync(void *vaddr, size_t size, int direction)
unsigned long start = (unsigned long)vaddr;
unsigned long end = start + size;
+ BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end));
+
switch (direction) {
case DMA_FROM_DEVICE: /* invalidate only */
dmac_inv_range(start, end);
+ outer_inv_range(__pa(start), __pa(end));
break;
case DMA_TO_DEVICE: /* writeback only */
dmac_clean_range(start, end);
+ outer_clean_range(__pa(start), __pa(end));
break;
case DMA_BIDIRECTIONAL: /* writeback and invalidate */
dmac_flush_range(start, end);
+ outer_flush_range(__pa(start), __pa(end));
break;
default:
BUG();