summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-03-04 09:59:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-03-04 09:59:51 -0800
commit6587457b4b3d663b237a0f95ddf6e67d1828c8ea (patch)
tree401b57623047ebcd1e30d926d50667ce49521f1e
parentb8e81a3b68c57b2ea7b661424f2ab8cf06f15e42 (diff)
parent4eb2440ed60fb5793f7aa6da89b3d517cc59de43 (diff)
downloadop-kernel-dev-6587457b4b3d663b237a0f95ddf6e67d1828c8ea.zip
op-kernel-dev-6587457b4b3d663b237a0f95ddf6e67d1828c8ea.tar.gz
Merge tag 'dma-buf-for-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits/dma-buf
Pull dma-buf fixes from Sumit Semwal: "Minor timeout & other fixes on reservation/fence" * tag 'dma-buf-for-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits/dma-buf: reservation: Remove shadowing local variable 'ret' dma-buf/fence: don't wait when specified timeout is zero reservation: wait only with non-zero timeout specified (v3)
-rw-r--r--drivers/dma-buf/fence.c3
-rw-r--r--drivers/dma-buf/reservation.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c
index e554111..50ef8bd 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);
diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index 3c97c8f..39920d7 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -327,6 +327,9 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
unsigned seq, shared_count, i = 0;
long ret = timeout;
+ if (!timeout)
+ return reservation_object_test_signaled_rcu(obj, wait_all);
+
retry:
fence = NULL;
shared_count = 0;
@@ -402,8 +405,6 @@ reservation_object_test_signaled_single(struct fence *passed_fence)
int ret = 1;
if (!test_bit(FENCE_FLAG_SIGNALED_BIT, &lfence->flags)) {
- int ret;
-
fence = fence_get_rcu(lfence);
if (!fence)
return -1;
OpenPOWER on IntegriCloud