summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-08-19 21:39:54 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-21 19:12:20 +0900
commit4d96b021922ae73278db61900263d695a8e8a1ad (patch)
tree8fb6a2c14bb93cff35512d968a6f432a968e5521
parent4938e4c31816bf043efb943cc2817d8fab1351c9 (diff)
downloadlinux-3.10-4d96b021922ae73278db61900263d695a8e8a1ad.tar.gz
linux-3.10-4d96b021922ae73278db61900263d695a8e8a1ad.tar.bz2
linux-3.10-4d96b021922ae73278db61900263d695a8e8a1ad.zip
Revert "dmabuf-sync: add select system call support."
This reverts commit 4439a419906d4fe3d7e5093292bd2f4f4fbfc8c2.
-rw-r--r--drivers/base/dma-buf.c48
-rw-r--r--drivers/base/dmabuf-sync.c18
-rw-r--r--include/linux/dmabuf-sync.h5
3 files changed, 0 insertions, 71 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index fa42c56b30d..3d2d12bd058 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -29,7 +29,6 @@
#include <linux/export.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
-#include <linux/poll.h>
#include <linux/dmabuf-sync.h>
static inline int is_dma_buf_file(struct file *);
@@ -81,52 +80,6 @@ static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma)
return dmabuf->ops->mmap(dmabuf, vma);
}
-static unsigned int dma_buf_poll(struct file *filp,
- struct poll_table_struct *poll)
-{
- struct dma_buf *dmabuf;
- struct dmabuf_sync_reservation *robj;
- int ret = 0;
-
- if (!is_dma_buf_file(filp))
- return POLLERR;
-
- dmabuf = filp->private_data;
- if (!dmabuf || !dmabuf->sync)
- return POLLERR;
-
- robj = dmabuf->sync;
-
- mutex_lock(&robj->lock);
-
- robj->polled = true;
-
- /*
- * CPU or DMA access to this buffer has been completed, and
- * the blocked task has been waked up. Return poll event
- * so that the task can get out of select().
- */
- if (robj->poll_event) {
- robj->poll_event = false;
- mutex_unlock(&robj->lock);
- return POLLIN | POLLOUT;
- }
-
- /*
- * There is no anyone accessing this buffer so just return POLLERR.
- */
- if (!robj->locked) {
- mutex_unlock(&robj->lock);
- return POLLERR;
- }
-
- poll_wait(filp, &robj->poll_wait, poll);
-
- mutex_unlock(&robj->lock);
-
- return ret;
-}
-
static int dma_buf_lock(struct file *file, int cmd, struct file_lock *fl)
{
struct dma_buf *dmabuf;
@@ -162,7 +115,6 @@ static int dma_buf_lock(struct file *file, int cmd, struct file_lock *fl)
static const struct file_operations dma_buf_fops = {
.release = dma_buf_release,
.mmap = dma_buf_mmap_internal,
- .poll = dma_buf_poll,
.lock = dma_buf_lock,
};
diff --git a/drivers/base/dmabuf-sync.c b/drivers/base/dmabuf-sync.c
index dab5b32a833..abfd8e3f009 100644
--- a/drivers/base/dmabuf-sync.c
+++ b/drivers/base/dmabuf-sync.c
@@ -63,12 +63,6 @@ static void dmabuf_sync_timeout_worker(struct work_struct *work)
continue;
}
- if (sobj->robj->polled) {
- sobj->robj->poll_event = true;
- sobj->robj->polled = false;
- wake_up_interruptible(&sobj->robj->poll_wait);
- }
-
if (atomic_add_unless(&sobj->robj->shared_cnt, -1, 1)) {
mutex_unlock(&sobj->robj->lock);
continue;
@@ -283,12 +277,6 @@ static void dmabuf_sync_unlock_objs(struct dmabuf_sync *sync,
list_for_each_entry(sobj, &sync->syncs, head) {
mutex_lock(&sobj->robj->lock);
- if (sobj->robj->polled) {
- sobj->robj->poll_event = true;
- sobj->robj->polled = false;
- wake_up_interruptible(&sobj->robj->poll_wait);
- }
-
if (atomic_add_unless(&sobj->robj->shared_cnt, -1, 1)) {
mutex_unlock(&sobj->robj->lock);
continue;
@@ -636,12 +624,6 @@ void dmabuf_sync_single_unlock(struct dma_buf *dmabuf)
mutex_lock(&robj->lock);
- if (robj->polled) {
- robj->poll_event = true;
- robj->polled = false;
- wake_up_interruptible(&robj->poll_wait);
- }
-
if (atomic_add_unless(&robj->shared_cnt, -1 , 1)) {
mutex_unlock(&robj->lock);
dma_buf_put(dmabuf);
diff --git a/include/linux/dmabuf-sync.h b/include/linux/dmabuf-sync.h
index 9a3afc4870a..d4dcf4f84cd 100644
--- a/include/linux/dmabuf-sync.h
+++ b/include/linux/dmabuf-sync.h
@@ -22,9 +22,6 @@ enum dmabuf_sync_status {
struct dmabuf_sync_reservation {
struct ww_mutex sync_lock;
struct mutex lock;
- wait_queue_head_t poll_wait;
- unsigned int poll_event;
- unsigned int polled;
atomic_t shared_cnt;
unsigned int accessed_type;
unsigned int locked;
@@ -94,8 +91,6 @@ static inline void dmabuf_sync_reservation_init(struct dma_buf *dmabuf)
mutex_init(&obj->lock);
atomic_set(&obj->shared_cnt, 1);
-
- init_waitqueue_head(&obj->poll_wait);
}
static inline void dmabuf_sync_reservation_fini(struct dma_buf *dmabuf)