Skip to content

Commit

Permalink
reservation: wait only with non-zero timeout specified (v3)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jammy Zhou authored and Sumit Semwal committed Jan 22, 2015
1 parent b942c65 commit fb8b7d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 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

0 comments on commit fb8b7d2

Please sign in to comment.