diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 6f73363c2282..9fdf4f742186 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -5,6 +5,7 @@ * Copyright (C) 2011 Google, Inc. */ +#include #include #include #include @@ -189,6 +190,17 @@ static int ion_system_heap_allocate(struct ion_heap *heap, } buffer->sg_table = table; + + if (!(buffer->flags & ION_FLAG_CACHED)) { + for_each_sg(table->sgl, sg, table->orig_nents, i) { + void *start; + + page = sg_page(sg); + start = page_address(page); + dmac_flush_range(start, start + sg->length); + } + } + return 0; free_table: