staging: android: ion: do cache flush for system heap pages

Change-Id: I57505aaee2c2f9af796313bfc729cef0ce9cfece
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
Jianqun Xu
2021-02-24 15:24:22 +08:00
committed by Tao Huang
parent c51d10ea44
commit bec15067c2

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2011 Google, Inc.
*/
#include <asm/cacheflush.h>
#include <asm/page.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
@@ -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: