All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reservation: wait only with non-zero timeout specified (v3)
@ 2015-01-13  9:36 Jammy Zhou
  2015-01-13  9:04 ` Maarten Lankhorst
  0 siblings, 1 reply; 9+ messages in thread
From: Jammy Zhou @ 2015-01-13  9:36 UTC (permalink / raw)
  To: dri-devel; +Cc: alexander.deucher, christian.koenig

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>
---
 drivers/dma-buf/reservation.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index 3c97c8f..807ef15 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;
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-21  9:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13  9:36 [PATCH] reservation: wait only with non-zero timeout specified (v3) Jammy Zhou
2015-01-13  9:04 ` Maarten Lankhorst
2015-01-13  9:19   ` Zhou, Jammy
2015-01-13  9:22   ` Christian König
2015-01-13 10:18     ` Maarten Lankhorst
2015-01-13 22:10       ` Daniel Vetter
2015-01-14  2:16         ` Zhou, Jammy
2015-01-21  9:12           ` Maarten Lankhorst
2015-01-21  9:35             ` Zhou, Jammy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.