[COMMON] ion: skip cache maintenance when DMA_NONE
authorhyesoo.yu <hyesoo.yu@samsung.com>
Thu, 31 May 2018 09:03:10 +0000 (18:03 +0900)
committerJanghyuck Kim <janghyuck.kim@samsung.com>
Mon, 23 Jul 2018 05:39:29 +0000 (14:39 +0900)
Change-Id: Ifd6fc48d15a7d5b1330431e8bf0366441e2e9dba
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/staging/android/ion/ion_exynos.c

index 5e30b6a8163d67155daf881b5c0cbaeb8df14284..e41f51a00771d4f2dc7800ca6b91c61fa7c38197 100644 (file)
@@ -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);
 }