All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: fix another potential dma_resv DAG violation
@ 2021-09-22 11:41 Christian König
  2021-09-22 12:28 ` Lucas Stach
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2021-09-22 11:41 UTC (permalink / raw)
  To: l.stach, daniel, etnaviv, dri-devel

Setting the exclusive fence without waiting for the shared
fences violates the DAG and is illegal.

We really need to get away from this ASAP and make the
driver interface more bullet prove.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: <stable@vger.kernel.org>
---
 drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 7e17bc2b5df1..4db40e88f67f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -185,19 +185,15 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
 				return ret;
 		}
 
-		if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
-			continue;
-
 		if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
 			ret = dma_resv_get_fences(robj, &bo->excl,
 						  &bo->nr_shared,
 						  &bo->shared);
 			if (ret)
 				return ret;
-		} else {
+		} else if (!(submit->flags & ETNA_SUBMIT_NO_IMPLICIT)) {
 			bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
 		}
-
 	}
 
 	return ret;
-- 
2.25.1


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

* Re: [PATCH] drm/etnaviv: fix another potential dma_resv DAG violation
  2021-09-22 11:41 [PATCH] drm/etnaviv: fix another potential dma_resv DAG violation Christian König
@ 2021-09-22 12:28 ` Lucas Stach
  2021-09-22 12:35   ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2021-09-22 12:28 UTC (permalink / raw)
  To: Christian König, daniel, etnaviv, dri-devel

Am Mittwoch, dem 22.09.2021 um 13:41 +0200 schrieb Christian König:
> Setting the exclusive fence without waiting for the shared
> fences violates the DAG and is illegal.
> 
> We really need to get away from this ASAP and make the
> driver interface more bullet prove.

Uh, what happened to Daniels patch "drm/etnaviv: Don't break exclusive
fence ordering", which fixed this without totally doing away with the
no-implicit handling? I have to admit that I haven't followed up with
that patch series due to ETOOMUCHOTHERSTUFF, but from a quick glance
this patch looked better than what you propose here.

Regards,
Lucas

> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> index 7e17bc2b5df1..4db40e88f67f 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> @@ -185,19 +185,15 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
>  				return ret;
>  		}
>  
> -		if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
> -			continue;
> -
>  		if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
>  			ret = dma_resv_get_fences(robj, &bo->excl,
>  						  &bo->nr_shared,
>  						  &bo->shared);
>  			if (ret)
>  				return ret;
> -		} else {
> +		} else if (!(submit->flags & ETNA_SUBMIT_NO_IMPLICIT)) {
>  			bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
>  		}
> -
>  	}
>  
>  	return ret;



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

* Re: [PATCH] drm/etnaviv: fix another potential dma_resv DAG violation
  2021-09-22 12:28 ` Lucas Stach
@ 2021-09-22 12:35   ` Christian König
  0 siblings, 0 replies; 3+ messages in thread
From: Christian König @ 2021-09-22 12:35 UTC (permalink / raw)
  To: Lucas Stach, daniel, etnaviv, dri-devel

Am 22.09.21 um 14:28 schrieb Lucas Stach:
> Am Mittwoch, dem 22.09.2021 um 13:41 +0200 schrieb Christian König:
>> Setting the exclusive fence without waiting for the shared
>> fences violates the DAG and is illegal.
>>
>> We really need to get away from this ASAP and make the
>> driver interface more bullet prove.
> Uh, what happened to Daniels patch "drm/etnaviv: Don't break exclusive
> fence ordering", which fixed this without totally doing away with the
> no-implicit handling?

I was wondering the same thing. My memory was that Daniel has already 
fixed this, but that still looks totally broken to me.

> I have to admit that I haven't followed up with
> that patch series due to ETOOMUCHOTHERSTUFF, but from a quick glance
> this patch looked better than what you propose here.

This patch here should have the same result as Daniels version, just 
with CC: stable on it, fewer changes lines and not depending on the 
drm_sched_job_await_implicit() change.

Regards,
Christian.

>
> Regards,
> Lucas
>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> Cc: <stable@vger.kernel.org>
>> ---
>>   drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +-----
>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
>> index 7e17bc2b5df1..4db40e88f67f 100644
>> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
>> @@ -185,19 +185,15 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
>>   				return ret;
>>   		}
>>   
>> -		if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
>> -			continue;
>> -
>>   		if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
>>   			ret = dma_resv_get_fences(robj, &bo->excl,
>>   						  &bo->nr_shared,
>>   						  &bo->shared);
>>   			if (ret)
>>   				return ret;
>> -		} else {
>> +		} else if (!(submit->flags & ETNA_SUBMIT_NO_IMPLICIT)) {
>>   			bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
>>   		}
>> -
>>   	}
>>   
>>   	return ret;
>


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

end of thread, other threads:[~2021-09-22 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 11:41 [PATCH] drm/etnaviv: fix another potential dma_resv DAG violation Christian König
2021-09-22 12:28 ` Lucas Stach
2021-09-22 12:35   ` Christian König

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.