Commit 84013bb4 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Greg Kroah-Hartman

staging/android: remove SYNC_WAIT ioctl

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: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fb78ad6
...@@ -300,44 +300,6 @@ struct sync_file *sync_file_merge(const char *name, ...@@ -300,44 +300,6 @@ struct sync_file *sync_file_merge(const char *name,
} }
EXPORT_SYMBOL(sync_file_merge); 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) static const char *android_fence_get_driver_name(struct fence *fence)
{ {
struct sync_timeline *parent = fence_parent(fence); struct sync_timeline *parent = fence_parent(fence);
...@@ -478,17 +440,6 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait) ...@@ -478,17 +440,6 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait)
return 0; 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, static long sync_file_ioctl_merge(struct sync_file *sync_file,
unsigned long arg) unsigned long arg)
{ {
...@@ -629,9 +580,6 @@ static long sync_file_ioctl(struct file *file, unsigned int cmd, ...@@ -629,9 +580,6 @@ static long sync_file_ioctl(struct file *file, unsigned int cmd,
struct sync_file *sync_file = file->private_data; struct sync_file *sync_file = file->private_data;
switch (cmd) { switch (cmd) {
case SYNC_IOC_WAIT:
return sync_file_ioctl_wait(sync_file, arg);
case SYNC_IOC_MERGE: case SYNC_IOC_MERGE:
return sync_file_ioctl_merge(sync_file, arg); return sync_file_ioctl_merge(sync_file, arg);
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/fence.h> #include <linux/fence.h>
#include "uapi/sync.h" #include "uapi/sync.h"
...@@ -230,18 +229,6 @@ void sync_file_put(struct sync_file *sync_file); ...@@ -230,18 +229,6 @@ void sync_file_put(struct sync_file *sync_file);
*/ */
void sync_file_install(struct sync_file *sync_file, int fd); 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 #ifdef CONFIG_DEBUG_FS
void sync_timeline_debug_add(struct sync_timeline *obj); void sync_timeline_debug_add(struct sync_timeline *obj);
......
...@@ -32,50 +32,6 @@ TRACE_EVENT(sync_timeline, ...@@ -32,50 +32,6 @@ TRACE_EVENT(sync_timeline,
TP_printk("name=%s value=%s", __get_str(name), __entry->value) 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) */ #endif /* if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) */
/* This part must be outside protection */ /* This part must be outside protection */
......
...@@ -64,13 +64,6 @@ struct sync_file_info_data { ...@@ -64,13 +64,6 @@ struct sync_file_info_data {
#define SYNC_IOC_MAGIC '>' #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 * DOC: SYNC_IOC_MERGE - merge two fences
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment