From f83038a27e78098a45f11479f8d9c04b57071434 Mon Sep 17 00:00:00 2001 From: "hyesoo.yu" Date: Thu, 31 May 2018 18:15:29 +0900 Subject: [PATCH] Revert "android: ion: add dmabuf cpu access ops for exynos" This reverts commit 6e3e01a3504e7873d16777b1bf3f2ee54ec97cb7. Change-Id: I843b42d82681c25fbec7df58710e2b00cd70caf6 --- drivers/staging/android/ion/ion.c | 42 ++++++++----------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index f2cdff7f9160..42b0fa3c275e 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -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); -- 2.20.1