diff options
author | Jammy Zhou <Jammy.Zhou@amd.com> | 2015-01-21 11:35:47 +0100 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2015-01-22 06:57:57 +0100 |
commit | fb8b7d2b9d80e1e71f379e57355936bd2b024be9 (patch) | |
tree | 8aa091a8b4cd62f330f9397ee43c99c6df8aa13f /drivers/dma-buf | |
parent | Merge tag 'trace-sh-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ro... (diff) | |
download | linux-fb8b7d2b9d80e1e71f379e57355936bd2b024be9.tar.xz linux-fb8b7d2b9d80e1e71f379e57355936bd2b024be9.zip |
reservation: wait only with non-zero timeout specified (v3)
When the timeout value passed to reservation_object_wait_timeout_rcu
is zero, no wait should be done if the fences are not signaled.
Return '1' for idle and '0' for busy if the specified timeout is '0'
to keep consistent with the case of non-zero timeout.
v2: call fence_put if not signaled in the case of timeout==0
v3: switch to reservation_object_test_signaled_rcu
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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/reservation.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 3c97c8fa8d02..807ef1555255 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; |