reservation: fix reservation_object_wait_timeout_rcu result

Submitted by Christian König on Oct. 19, 2016, 5:59 p.m.

Details

Message ID 1476899945-2264-1-git-send-email-deathsimple@vodafone.de
State New
Headers show
Series "reservation: fix reservation_object_wait_timeout_rcu result" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Christian König Oct. 19, 2016, 5:59 p.m.
From: Christian König <christian.koenig@amd.com>

Return one when the timeout is zero and we don't got any fences.

Fixes "reservation: revert "wait only with non-zero timeout specified (v3)"".

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/reservation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index bb97b04..debb91d 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -379,7 +379,7 @@  long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
 {
 	struct fence *fence;
 	unsigned seq, shared_count, i = 0;
-	long ret = timeout;
+	long ret = timeout ? timeout : 1;
 
 retry:
 	fence = NULL;

Comments

On Wed, Oct 19, 2016 at 1:59 PM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Return one when the timeout is zero and we don't got any fences.
>
> Fixes "reservation: revert "wait only with non-zero timeout specified (v3)"".
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

You should make sure you cc Sumit on these patches as I think they
would need to go upstream via the dma-buf tree.   Also respin a v2
with this fix integrated.

Alex

> ---
>  drivers/dma-buf/reservation.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
> index bb97b04..debb91d 100644
> --- a/drivers/dma-buf/reservation.c
> +++ b/drivers/dma-buf/reservation.c
> @@ -379,7 +379,7 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
>  {
>         struct fence *fence;
>         unsigned seq, shared_count, i = 0;
> -       long ret = timeout;
> +       long ret = timeout ? timeout : 1;
>
>  retry:
>         fence = NULL;
> --
> 2.5.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel