Revert "android: ion: add dmabuf cpu access ops for exynos"
authorhyesoo.yu <hyesoo.yu@samsung.com>
Thu, 31 May 2018 09:15:29 +0000 (18:15 +0900)
committerJanghyuck Kim <janghyuck.kim@samsung.com>
Mon, 23 Jul 2018 05:39:30 +0000 (14:39 +0900)
This reverts commit 6e3e01a3504e7873d16777b1bf3f2ee54ec97cb7.

Change-Id: I843b42d82681c25fbec7df58710e2b00cd70caf6

drivers/staging/android/ion/ion.c

index f2cdff7f91606d3a8cad768e761c23e49a2a4cf1..42b0fa3c275e2a748de87b83761d90b8b8e7c6f2 100644 (file)
@@ -368,23 +368,12 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
                mutex_unlock(&buffer->lock);
        }
 
-       if (!ion_buffer_cached(buffer))
-               return 0;
-
        mutex_lock(&dmabuf->lock);
-       if (IS_ENABLED(CONFIG_ION_EXYNOS)) {
-               if (!list_empty(&dmabuf->attachments))
-                       dma_sync_sg_for_cpu(buffer->dev->dev.this_device,
-                                           buffer->sg_table->sgl,
-                                           buffer->sg_table->orig_nents,
-                                           direction);
-       } else {
-               list_for_each_entry(att, &dmabuf->attachments, node) {
-                       struct sg_table *table = att->priv;
-
-                       dma_sync_sg_for_cpu(att->dev, table->sgl, table->nents,
-                                           direction);
-               }
+       list_for_each_entry(att, &dmabuf->attachments, node) {
+               struct sg_table *table = att->priv;
+
+               dma_sync_sg_for_cpu(att->dev, table->sgl, table->nents,
+                                   direction);
        }
        mutex_unlock(&dmabuf->lock);
 
@@ -403,23 +392,12 @@ static int ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
                mutex_unlock(&buffer->lock);
        }
 
-       if (!ion_buffer_cached(buffer))
-               return 0;
-
        mutex_lock(&dmabuf->lock);
-       if (IS_ENABLED(CONFIG_ION_EXYNOS)) {
-               if (!list_empty(&dmabuf->attachments))
-                       dma_sync_sg_for_device(buffer->dev->dev.this_device,
-                                              buffer->sg_table->sgl,
-                                              buffer->sg_table->orig_nents,
-                                              direction);
-       } else {
-               list_for_each_entry(att, &dmabuf->attachments, node) {
-                       struct sg_table *table = att->priv;
-
-                       dma_sync_sg_for_device(att->dev, table->sgl,
-                                              table->nents, direction);
-               }
+       list_for_each_entry(att, &dmabuf->attachments, node) {
+               struct sg_table *table = att->priv;
+
+               dma_sync_sg_for_device(att->dev, table->sgl, table->nents,
+                                      direction);
        }
        mutex_unlock(&dmabuf->lock);