Skip to content

Commit

Permalink
dma-buf/fence: don't wait when specified timeout is zero
Browse files Browse the repository at this point in the history
When specified timeout is zero for fence_wait_timeout, just check if the fence
is signaled or not without wait.

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-By: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
  • Loading branch information
Jammy Zhou authored and Sumit Semwal committed Jan 22, 2015
1 parent fb8b7d2 commit 847b19a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/dma-buf/fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ fence_wait_timeout(struct fence *fence, bool intr, signed long timeout)
if (WARN_ON(timeout < 0))
return -EINVAL;

if (timeout == 0)
return fence_is_signaled(fence);

trace_fence_wait_start(fence);
ret = fence->ops->wait(fence, intr, timeout);
trace_fence_wait_end(fence);
Expand Down

0 comments on commit 847b19a

Please sign in to comment.