Skip to contentSkip to conversation

reservation: wait only with non-zero timeout specified (v3)

PATCH In review Jammy Zhou 5 participants 9 messages Jan 21, 2015 – Jan 22, 2015 DMA buffer sharing framework

lore
Share & tools
lore

Jammy Zhou

author
#0 lore raw

PATCH 1/2 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

---
 drivers/dma-buf/reservation.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma-buf/reservation.c +3 -0
index 3c97c8f..807ef15 100644
@@ -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;
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#1 lore raw

PATCH 2/2 dma-buf/fence: don't wait when specified timeout is zero

When specified timeout is zero for fence_wait_timeout, just check if the fence is signaled or not without wait.

---
 drivers/dma-buf/fence.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma-buf/fence.c +3 -0
index e554111..50ef8bd 100644
@@ -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);
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] dma-buf/fence: don't wait when specified timeout is zero

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 5 lines

When specified timeout is zero for fence_wait_timeout, just check if the fence is signaled or not without wait.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] dma-buf/fence: don't wait when specified timeout is zero

In reply to Jammy Zhou

Am 21.01.2015 um 11:35 schrieb Jammy Zhou:

Quoted 4 lines

When specified timeout is zero for fence_wait_timeout, just check if the fence is signaled or not without wait.

Quoted 9 lines
---
  drivers/dma-buf/fence.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/dma-buf/fence.c +0 -0
index e554111..50ef8bd 100644

drivers/dma-buf/fence.c fence_wait_timeout(struct fence *fence, bool intr, signed long timeout) · line 167

Quoted 9 lines
drivers/dma-buf/fence.c +3 -0
@@ -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);

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/2
#4 lore raw
In reply to Jammy Zhou

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 6 lines

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.

Quoted 8 lines

v2: call fence_put if not signaled in the case of timeout==0

v3: switch to reservation_object_test_signaled_rcu

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 9 lines · Maarten Lankhorst

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 8 lines

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

Quoted 7 lines
Quoted 6 lines

v3: switch to reservation_object_test_signaled_rcu

Dave, Maarten,

Do you want to pick these up, or would you rather I pulled them through my tree?

Thanks,

Alex
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Hey,

Quoted 17 lines · Alex Deucher
Quoted 15 lines · Maarten Lankhorst

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 14 lines

When the timeout value passed to reservation_object_wait_timeout_rcuy, 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

Quoted 5 lines
Quoted 1 line

Dave, Maarten,

Do you want to pick these up, or would you rather I pulled them through my tree?

This goes through Sumit Semwal's tree. He's the dma-buf maintainer and I already made him aware of the patches.

~Maarten
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 20 lines · Maarten Lankhorst

Hey,

Quoted 17 lines · Alex Deucher
Quoted 15 lines · Maarten Lankhorst

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 14 lines

When the timeout value passed to reservation_object_wait_timeout_rcuy, 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

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Dave, Maarten,

Do you want to pick these up, or would you rather I pulled them through my tree?

This goes through Sumit Semwal's tree. He's the dma-buf maintainer and I already made him aware of the patches.

Thanks!

Alex
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#8 lore raw

Hi Jammy, All,

Quoted 22 lines · Alex Deucher
Quoted 20 lines · Maarten Lankhorst

Hey,

Quoted 17 lines · Alex Deucher
Quoted 15 lines · Maarten Lankhorst

Op 21-01-15 om 11:35 schreef Jammy Zhou:

Quoted 14 lines

When the timeout value passed to reservation_object_wait_timeout_rcuy, 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

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Dave, Maarten,

Do you want to pick these up, or would you rather I pulled them through my tree?

This goes through Sumit Semwal's tree. He's the dma-buf maintainer and I already made him aware of the patches.

Both these patches are now pulled and pushed out to my for-next branch.

Quoted 4 lines

Thanks!

Alex

Signature · 6 lines
Thanks and Best regards,
Sumit.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel