mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user