staging/android: remove SYNC_WAIT ioctl
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 3 Feb 2016 13:25:30 +0000 (11:25 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 01:34:58 +0000 (17:34 -0800)
This ioctl is replicating the work of poll() syscall so let's take the
opportunity that this is still on staging tree and remove the duplication
and force new users to use the poll() standard interface.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/sync.c
drivers/staging/android/sync.h
drivers/staging/android/trace/sync.h
drivers/staging/android/uapi/sync.h

index 5fa4779a1956f81245c2a6f1c982133fcf2d9113..381209a9dc2d0528bf1e7e73a2446e740ab9466d 100644 (file)
@@ -300,44 +300,6 @@ struct sync_file *sync_file_merge(const char *name,
 }
 EXPORT_SYMBOL(sync_file_merge);
 
-int sync_file_wait(struct sync_file *sync_file, long timeout)
-{
-       long ret;
-       int i;
-
-       if (timeout < 0)
-               timeout = MAX_SCHEDULE_TIMEOUT;
-       else
-               timeout = msecs_to_jiffies(timeout);
-
-       trace_sync_wait(sync_file, 1);
-       for (i = 0; i < sync_file->num_fences; ++i)
-               trace_fence(sync_file->cbs[i].fence);
-       ret = wait_event_interruptible_timeout(sync_file->wq,
-                                              atomic_read(&sync_file->status) <= 0,
-                                              timeout);
-       trace_sync_wait(sync_file, 0);
-
-       if (ret < 0) {
-               return ret;
-       } else if (ret == 0) {
-               if (timeout) {
-                       pr_info("sync_file timeout on [%p] after %dms\n",
-                               sync_file, jiffies_to_msecs(timeout));
-                       sync_dump();
-               }
-               return -ETIME;
-       }
-
-       ret = atomic_read(&sync_file->status);
-       if (ret) {
-               pr_info("sync_file error %ld on [%p]\n", ret, sync_file);
-               sync_dump();
-       }
-       return ret;
-}
-EXPORT_SYMBOL(sync_file_wait);
-
 static const char *android_fence_get_driver_name(struct fence *fence)
 {
        struct sync_timeline *parent = fence_parent(fence);
@@ -478,17 +440,6 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait)
        return 0;
 }
 
-static long sync_file_ioctl_wait(struct sync_file *sync_file,
-                                 unsigned long arg)
-{
-       __s32 value;
-
-       if (copy_from_user(&value, (void __user *)arg, sizeof(value)))
-               return -EFAULT;
-
-       return sync_file_wait(sync_file, value);
-}
-
 static long sync_file_ioctl_merge(struct sync_file *sync_file,
                                   unsigned long arg)
 {
@@ -629,9 +580,6 @@ static long sync_file_ioctl(struct file *file, unsigned int cmd,
        struct sync_file *sync_file = file->private_data;
 
        switch (cmd) {
-       case SYNC_IOC_WAIT:
-               return sync_file_ioctl_wait(sync_file, arg);
-
        case SYNC_IOC_MERGE:
                return sync_file_ioctl_merge(sync_file, arg);
 
index 8980b5580fb38a60b81c6d61b62bd112e847f75a..af1af998949c33d26555334f271e3d8414f37163 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/ktime.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
-#include <linux/wait.h>
 #include <linux/fence.h>
 
 #include "uapi/sync.h"
@@ -230,18 +229,6 @@ void sync_file_put(struct sync_file *sync_file);
  */
 void sync_file_install(struct sync_file *sync_file, int fd);
 
-/**
- * sync_file_wait() - wait on sync file
- * @sync_file: file to wait on
- * @tiemout:   timeout in ms
- *
- * Wait for @sync_file to be signaled or have an error. Waits indefinitely
- * if @timeout < 0.
- *
- * Returns 0 if fence signaled, > 0 if it is still active and <0 on error
- */
-int sync_file_wait(struct sync_file *sync_file, long timeout);
-
 #ifdef CONFIG_DEBUG_FS
 
 void sync_timeline_debug_add(struct sync_timeline *obj);
index 87c60e9f584e005b682aa75c197795b584d6dd24..a0f80f41677ef6ffae1df895e7e48bb680370597 100644 (file)
@@ -32,50 +32,6 @@ TRACE_EVENT(sync_timeline,
        TP_printk("name=%s value=%s", __get_str(name), __entry->value)
 );
 
-TRACE_EVENT(sync_wait,
-       TP_PROTO(struct sync_file *sync_file, int begin),
-
-       TP_ARGS(sync_file, begin),
-
-       TP_STRUCT__entry(
-                       __string(name, sync_file->name)
-                       __field(s32, status)
-                       __field(u32, begin)
-       ),
-
-       TP_fast_assign(
-                       __assign_str(name, sync_file->name);
-                       __entry->status = atomic_read(&sync_file->status);
-                       __entry->begin = begin;
-       ),
-
-       TP_printk("%s name=%s state=%d", __entry->begin ? "begin" : "end",
-                       __get_str(name), __entry->status)
-);
-
-TRACE_EVENT(fence,
-       TP_PROTO(struct fence *fence),
-
-       TP_ARGS(fence),
-
-       TP_STRUCT__entry(
-               __string(timeline, fence->ops->get_timeline_name(fence))
-               __array(char, value, 32)
-       ),
-
-       TP_fast_assign(
-               __assign_str(timeline, fence->ops->get_timeline_name(fence));
-               if (fence->ops->fence_value_str) {
-                       fence->ops->fence_value_str(fence, __entry->value,
-                                                       sizeof(__entry->value));
-               } else {
-                       __entry->value[0] = '\0';
-               }
-       ),
-
-       TP_printk("name=%s value=%s", __get_str(timeline), __entry->value)
-);
-
 #endif /* if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) */
 
 /* This part must be outside protection */
index 73deb6907ce1e022b944a4c8376e2a4a1dcab261..6c88c8080d1e0d5883b99c54498702e974fde3d1 100644 (file)
@@ -64,13 +64,6 @@ struct sync_file_info_data {
 
 #define SYNC_IOC_MAGIC         '>'
 
-/**
- * DOC: SYNC_IOC_WAIT - wait for a fence to signal
- *
- * pass timeout in milliseconds.  Waits indefinitely timeout < 0.
- */
-#define SYNC_IOC_WAIT          _IOW(SYNC_IOC_MAGIC, 0, __s32)
-
 /**
  * DOC: SYNC_IOC_MERGE - merge two fences
  *