From: Rebecca Schultz Zavin Date: Fri, 13 Dec 2013 22:24:18 +0000 (-0800) Subject: gpu: ion: Don't flush allocatoins that come from the page pools X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8fae831288210dae626e212aaab459154b65ed79;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git gpu: ion: Don't flush allocatoins that come from the page pools Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index ad4933e1b421..02726a9702b1 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -76,9 +76,14 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, if (order > 4) gfp_flags = high_order_gfp_flags; page = alloc_pages(gfp_flags, order); + if (!page) + return 0; + __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << order, + DMA_BIDIRECTIONAL); } if (!page) return 0; + if (split_pages) split_page(page, order); return page; @@ -201,9 +206,6 @@ static int ion_system_heap_allocate(struct ion_heap *heap, kfree(info); } - dma_sync_sg_for_device(NULL, table->sgl, table->nents, - DMA_BIDIRECTIONAL); - buffer->priv_virt = table; return 0; err1: