From: Rebecca Schultz Zavin Date: Mon, 14 Jan 2013 23:29:10 +0000 (-0800) Subject: gpu: ion: Only flush buffers in the chunk heap if they were used cached X-Git-Tag: firefly_0821_release~4090^2~605 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aa74ef088598dd9b78d6731caa21c6f0c0c58fae;p=firefly-linux-kernel-4.4.55.git gpu: ion: Only flush buffers in the chunk heap if they were used cached Change-Id: I4ffcf81a6be09e968310bbd882fb017415d61b48 Signed-off-by: Rebecca Schultz Zavin --- diff --git a/drivers/gpu/ion/ion_chunk_heap.c b/drivers/gpu/ion/ion_chunk_heap.c index f65274d33067..687af63b9f5f 100644 --- a/drivers/gpu/ion/ion_chunk_heap.c +++ b/drivers/gpu/ion/ion_chunk_heap.c @@ -104,8 +104,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) ion_heap_buffer_zero(buffer); for_each_sg(table->sgl, sg, table->nents, i) { - __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), - DMA_BIDIRECTIONAL); + if (ion_buffer_cached(buffer)) + __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), + DMA_BIDIRECTIONAL); gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); }