drm/amdgpu: fix another missing fence reference in the CS code
Subsystems (2)
PATCH 1/2 drm/amdgpu: fix another missing fence reference in the CS code
drm_sched_job_add_dependency() consumes the references of the gang members. Only triggered by mesh shaders.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +4 -1
@@ -1254,9 +1254,12 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,continue ; fence = &p->jobs[i]->base.s_fence->scheduled; +dma_fence_get (fence); r =drm_sched_job_add_dependency (&leader->base, fence); -if (r) +if (r) { +dma_fence_put (fence); goto error_cleanup; + } }if (p->gang_size >1 ) {
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: fix missing dma_fence_put in error path
When the fence can't be added we need to drop the reference.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3 -1
@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; }
Signature · 1 line
2.34.1
Re: [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path
Quoted 5 lines · Christian König
When the fence can't be added we need to drop the reference.
Suggested-by Bert Karwatzki <[email protected]>Signed-off-by Christian König <[email protected]>
Series is:
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3
-2@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; } --2.34.1
Re: [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path
In reply to Christian KönigSeries is:
Regards,
Luben
Quoted 24 lines · Christian König
When the fence can't be added we need to drop the reference.
Suggested-by Bert Karwatzki <[email protected]>Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3
-1@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; }
Re: [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path
In reply to Christian KönigQuoted 5 lines · Christian König
When the fence can't be added we need to drop the reference.
Suggested-by Bert Karwatzki <[email protected]>Signed-off-by Christian König <[email protected]>
please add:
Cc: [email protected] # 6.1.x
When you push this series.
Alex
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3
-2@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; } --2.34.1
Re: [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path
Am 05.01.23 um 17:50 schrieb Alex Deucher:
Quoted 9 lines
Quoted 4 lines · Christian König
When the fence can't be added we need to drop the reference.
Suggested-by Bert Karwatzki <[email protected]>Signed-off-by Christian König <[email protected]>please add:
Cc: [email protected] # 6.1.x
When you push this series.
But none of this is in 6.1? That are pure 6.2 changes or am I missing something?
Christian.
Quoted 26 lines
Alex
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3
-2@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; } --2.34.1
Re: [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path
Quoted 6 lines · Christian König
Am 05.01.23 um 17:50 schrieb Alex Deucher:
Quoted 4 lines
Quoted 2 lines · Christian König
When the fence can't be added we need to drop the reference.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Suggested-by Bert Karwatzki <[email protected]>Signed-off-by Christian König <[email protected]>please add:
Cc: [email protected] # 6.1.x
When you push this series.But none of this is in 6.1? That are pure 6.2 changes or am I missing something?
I thought patch 1 fixed an issue in the gang submit code which was in 6.1, or was that fixing an issue in a subsequent change?
Alex
Quoted 30 lines
Christian.
Quoted 26 lines
Alex
Quoted 23 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +3
-2@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)dma_fence_get (f); r =drm_sched_job_add_dependency (&job->base, f); -if (r) +if (r) { +dma_fence_put (f);return r; + } }return 0 ; } --2.34.1