diff options
-rw-r--r-- | drivers/gpu/ion/ion_chunk_heap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/ion/ion_chunk_heap.c b/drivers/gpu/ion/ion_chunk_heap.c index f65274d3306..687af63b9f5 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) | |||
104 | ion_heap_buffer_zero(buffer); | 104 | ion_heap_buffer_zero(buffer); |
105 | 105 | ||
106 | for_each_sg(table->sgl, sg, table->nents, i) { | 106 | for_each_sg(table->sgl, sg, table->nents, i) { |
107 | __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), | 107 | if (ion_buffer_cached(buffer)) |
108 | DMA_BIDIRECTIONAL); | 108 | __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), |
109 | DMA_BIDIRECTIONAL); | ||
109 | gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), | 110 | gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), |
110 | sg_dma_len(sg)); | 111 | sg_dma_len(sg)); |
111 | } | 112 | } |