diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-04 09:59:51 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-04 09:59:51 -0800 |
commit | 6587457b4b3d663b237a0f95ddf6e67d1828c8ea (patch) | |
tree | 401b57623047ebcd1e30d926d50667ce49521f1e /drivers | |
parent | b8e81a3b68c57b2ea7b661424f2ab8cf06f15e42 (diff) | |
parent | 4eb2440ed60fb5793f7aa6da89b3d517cc59de43 (diff) | |
download | linux-stable-6587457b4b3d663b237a0f95ddf6e67d1828c8ea.tar.gz linux-stable-6587457b4b3d663b237a0f95ddf6e67d1828c8ea.tar.bz2 linux-stable-6587457b4b3d663b237a0f95ddf6e67d1828c8ea.zip |
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)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma-buf/fence.c | 3 | ||||
-rw-r--r-- | drivers/dma-buf/reservation.c | 5 |
2 files changed, 6 insertions, 2 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); diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 3c97c8fa8d02..39920d77f288 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; |