summaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-01-21 18:35:48 +0800
committerSumit Semwal <sumit.semwal@linaro.org>2015-01-22 11:28:51 +0530
commit847b19a39e4c9b5e74c40f0842c48b41664cb43c (patch)
tree021c2489569f3a29f06300b86bc2d78d99af24c2 /drivers/dma-buf
parentfb8b7d2b9d80e1e71f379e57355936bd2b024be9 (diff)
downloadlinux-847b19a39e4c9b5e74c40f0842c48b41664cb43c.tar.bz2
dma-buf/fence: don't wait when specified timeout is zero
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>
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r--drivers/dma-buf/fence.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c
index e5541117b3e9..50ef8bd8708b 100644
--- a/drivers/dma-buf/fence.c
+++ b/drivers/dma-buf/fence.c
@@ -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);