Message ID | 1386973529-4884-60-git-send-email-john.stultz@linaro.org |
---|---|
State | Accepted |
Headers | show |
diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 5582909..60cd91c 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/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)); }