drm/etnaviv: fix another potential dma_resv DAG violation
Subsystems (2)
PATCH 1/1 drm/etnaviv: fix another potential dma_resv DAG violation
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.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +1 -5
@@ -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;
Signature · 1 line
2.25.1
Lucas Stach
maintainerAm Mittwoch, dem 22.09.2021 um 13:41 +0200 schrieb Christian König:
Quoted 5 lines
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
Quoted 32 lines
Signed-off-by Christian König <[email protected]>Cc <[email protected]>--- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +1
-5@@ -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;
Am 22.09.21 um 14:28 schrieb Lucas Stach:
Quoted 9 lines
Am Mittwoch, dem 22.09.2021 um 13:41 +0200 schrieb Christian König:
Quoted 5 lines
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.
Quoted 3 lines
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.
Quoted 36 lines
Regards,
LucasQuoted 31 lines
Signed-off-by Christian König <[email protected]>Cc <[email protected]>--- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +1
-5@@ -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;