Skip to content

Commit

Permalink
Merge tag 'dma-buf-for-4.0-rc3' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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)
  • Loading branch information
torvalds committed Mar 4, 2015
2 parents b8e81a3 + 4eb2440 commit 6587457
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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
5 changes: 3 additions & 2 deletions drivers/dma-buf/reservation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6587457

Please sign in to comment.