From 1c9ddac95a51124745247571519ebbcf7c2cfdf6 Mon Sep 17 00:00:00 2001 From: "hyesoo.yu" Date: Thu, 31 May 2018 18:03:10 +0900 Subject: [PATCH] [COMMON] ion: skip cache maintenance when DMA_NONE Change-Id: Ifd6fc48d15a7d5b1330431e8bf0366441e2e9dba Signed-off-by: hyesoo.yu --- drivers/staging/android/ion/ion_exynos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_exynos.c b/drivers/staging/android/ion/ion_exynos.c index 5e30b6a8163d..e41f51a00771 100644 --- a/drivers/staging/android/ion/ion_exynos.c +++ b/drivers/staging/android/ion/ion_exynos.c @@ -225,7 +225,7 @@ struct sg_table *ion_exynos_map_dma_buf(struct dma_buf_attachment *attachment, { struct ion_buffer *buffer = attachment->dmabuf->priv; - if (ion_buffer_cached(buffer)) + if (ion_buffer_cached(buffer) && direction != DMA_NONE) dma_sync_sg_for_device(attachment->dev, buffer->sg_table->sgl, buffer->sg_table->nents, direction); @@ -238,7 +238,7 @@ void ion_exynos_unmap_dma_buf(struct dma_buf_attachment *attachment, { struct ion_buffer *buffer = attachment->dmabuf->priv; - if (ion_buffer_cached(buffer)) + if (ion_buffer_cached(buffer) && direction != DMA_NONE) dma_sync_sg_for_cpu(attachment->dev, table->sgl, table->nents, direction); } -- 2.20.1