summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-08-19 21:40:35 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-21 19:12:21 +0900
commita200aa101a8d1365d04e8e3bd893fa9d654027f2 (patch)
treedeebb7d5358db2ad9d2d278882c5401daa576aa5
parente1a318b9b57459588a1f8db97ff4b21fe39e2d2f (diff)
downloadlinux-3.10-a200aa101a8d1365d04e8e3bd893fa9d654027f2.tar.gz
linux-3.10-a200aa101a8d1365d04e8e3bd893fa9d654027f2.tar.bz2
linux-3.10-a200aa101a8d1365d04e8e3bd893fa9d654027f2.zip
Revert "dmabuf-sync: add cache operation feature"
This reverts commit 22a2b813ad54d967edf9d8117662fea25093f7d0.
-rw-r--r--drivers/base/dmabuf-sync.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/drivers/base/dmabuf-sync.c b/drivers/base/dmabuf-sync.c
index a4b8a50a2fe..0b831118c79 100644
--- a/drivers/base/dmabuf-sync.c
+++ b/drivers/base/dmabuf-sync.c
@@ -22,15 +22,6 @@
int dmabuf_sync_enabled = 1;
-#define NEED_BEGIN_CPU_ACCESS(old, new_type) \
- ((old->accessed_type & DMA_BUF_ACCESS_DMA_W) == \
- DMA_BUF_ACCESS_DMA_W && new_type == DMA_BUF_ACCESS_R)
-
-#define NEED_END_CPU_ACCESS(old, new_type) \
- (((old->accessed_type == DMA_BUF_ACCESS_W) || \
- (old->accessed_type == DMA_BUF_ACCESS_RW)) && \
- new_type & DMA_BUF_ACCESS_DMA)
-
MODULE_PARM_DESC(enabled, "Check if dmabuf sync is supported or not");
module_param_named(enabled, dmabuf_sync_enabled, int, 0444);
@@ -92,68 +83,6 @@ static void dmabuf_sync_timeout_worker(struct work_struct *work)
dmabuf_sync_fini(sync);
}
-static void dmabuf_sync_cache_ops(struct dmabuf_sync *sync)
-{
- struct dmabuf_sync_object *sobj;
-
- mutex_lock(&sync->lock);
-
- list_for_each_entry(sobj, &sync->syncs, head) {
- struct dma_buf *dmabuf;
-
- dmabuf = sobj->dmabuf;
- if (WARN_ON(!dmabuf || !sobj->robj))
- continue;
-
- mutex_lock(&sobj->robj->lock);
-
- /* first time access. */
- if (!sobj->robj->accessed_type)
- goto out;
-
- if (NEED_END_CPU_ACCESS(sobj->robj, sobj->access_type))
- /* cache clean */
- dma_buf_end_cpu_access(dmabuf, 0, dmabuf->size,
- DMA_TO_DEVICE);
- else if (NEED_BEGIN_CPU_ACCESS(sobj->robj, sobj->access_type))
- /* cache invalidate */
- dma_buf_begin_cpu_access(dmabuf, 0, dmabuf->size,
- DMA_FROM_DEVICE);
-
-out:
- /* Update access type to new one. */
- sobj->robj->accessed_type = sobj->access_type;
- mutex_unlock(&sobj->robj->lock);
- }
-
- mutex_unlock(&sync->lock);
-}
-
-static void dmabuf_sync_single_cache_ops(struct dma_buf *dmabuf,
- unsigned int access_type)
-{
- struct dmabuf_sync_reservation *robj;
-
- robj = dmabuf->sync;
-
- /* first time access. */
- if (!robj->accessed_type)
- goto out;
-
- if (NEED_END_CPU_ACCESS(robj, access_type))
- /* cache clean */
- dma_buf_end_cpu_access(dmabuf, 0, dmabuf->size,
- DMA_TO_DEVICE);
- else if (NEED_BEGIN_CPU_ACCESS(robj, access_type))
- /* cache invalidate */
- dma_buf_begin_cpu_access(dmabuf, 0, dmabuf->size,
- DMA_FROM_DEVICE);
-
-out:
- /* Update access type to new one. */
- robj->accessed_type = access_type;
-}
-
static void dmabuf_sync_lock_timeout(unsigned long arg)
{
struct dmabuf_sync *sync = (struct dmabuf_sync *)arg;
@@ -513,8 +442,6 @@ int dmabuf_sync_lock(struct dmabuf_sync *sync)
sync->status = DMABUF_SYNC_LOCKED;
- dmabuf_sync_cache_ops(sync);
-
return ret;
}
EXPORT_SYMBOL(dmabuf_sync_lock);
@@ -606,8 +533,6 @@ int dmabuf_sync_single_lock(struct dma_buf *dmabuf, unsigned int type,
mutex_lock(&robj->lock);
robj->locked = true;
-
- dmabuf_sync_single_cache_ops(dmabuf, type);
mutex_unlock(&robj->lock);
return 0;