Commit 3b640f5d authored by Erik Gilling's avatar Erik Gilling Committed by Greg Kroah-Hartman

staging: sync: Change wait timeout to mirror poll semantics

Change wait timeout to act like poll

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <robclark@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: default avatarErik Gilling <konkers@android.com>
[jstultz: Added commit message, squished typo-fix]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03e7a503
...@@ -557,14 +557,14 @@ EXPORT_SYMBOL(sync_fence_cancel_async); ...@@ -557,14 +557,14 @@ EXPORT_SYMBOL(sync_fence_cancel_async);
int sync_fence_wait(struct sync_fence *fence, long timeout) int sync_fence_wait(struct sync_fence *fence, long timeout)
{ {
int err; int err = 0;
if (timeout) { if (timeout > 0) {
timeout = msecs_to_jiffies(timeout); timeout = msecs_to_jiffies(timeout);
err = wait_event_interruptible_timeout(fence->wq, err = wait_event_interruptible_timeout(fence->wq,
fence->status != 0, fence->status != 0,
timeout); timeout);
} else { } else if (timeout < 0) {
err = wait_event_interruptible(fence->wq, fence->status != 0); err = wait_event_interruptible(fence->wq, fence->status != 0);
} }
......
...@@ -329,8 +329,8 @@ int sync_fence_cancel_async(struct sync_fence *fence, ...@@ -329,8 +329,8 @@ int sync_fence_cancel_async(struct sync_fence *fence,
* @fence: fence to wait on * @fence: fence to wait on
* @tiemout: timeout in ms * @tiemout: timeout in ms
* *
* Wait for @fence to be signaled or have an error. Waits indefintly * Wait for @fence to be signaled or have an error. Waits indefinitely
* if @timeout = 0 * if @timeout < 0
*/ */
int sync_fence_wait(struct sync_fence *fence, long timeout); int sync_fence_wait(struct sync_fence *fence, long timeout);
...@@ -389,9 +389,9 @@ struct sync_fence_info_data { ...@@ -389,9 +389,9 @@ struct sync_fence_info_data {
/** /**
* DOC: SYNC_IOC_WAIT - wait for a fence to signal * DOC: SYNC_IOC_WAIT - wait for a fence to signal
* *
* pass timeout in milliseconds. * pass timeout in milliseconds. Waits indefinitely timeout < 0.
*/ */
#define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __u32) #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