drm/panthor: Fix the "done_fence is initialized" detection logic
Subsystems (3)
Boris Brezillon
maintainerPATCH v2 1/1 drm/panthor: Fix the "done_fence is initialized" detection logic
After commit 541c8f2468b9 ("dma-buf: detach fence ops on signal v3"), dma_fence::ops == NULL can't be used to check if the fence is initialized. Use dma_fence_was_initialized() instead.
v2:
- Use dma_fence_was_initialized() instead of open-coding it
--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_sched.c +1 -1
@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);
Signature · 1 line
2.53.0
Quoted 7 lines · Boris Brezillon
After commit
541c8f2468b9("dma-buf: detach fence ops on signal v3"),dma_fence::ops== NULL can't be used to check if the fence is initialized. Usedma_fence_was_initialized()instead.v2:
- Usedma_fence_was_initialized()instead of open-coding it
Quoted 8 lines
Cc Nicolas Frattaroli <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Christian König <[email protected]>Reported-by Steven Price <[email protected]>Reported-by Nicolas Frattaroli <[email protected]>Fixes 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")Signed-off-by Boris Brezillon <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_sched.c +1
-1@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);
Quoted 25 lines · On Monday, 9 March 2026 13:43:18 Central European Standard Time Boris…
After commit
541c8f2468b9("dma-buf: detach fence ops on signal v3"),dma_fence::ops== NULL can't be used to check if the fence is initialized. Usedma_fence_was_initialized()instead.v2:
- Usedma_fence_was_initialized()instead of open-coding itCc Nicolas Frattaroli <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Christian König <[email protected]>Reported-by Steven Price <[email protected]>Reported-by Nicolas Frattaroli <[email protected]>Fixes 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")Signed-off-by Boris Brezillon <[email protected]>--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_sched.c +0
-0
drivers/gpu/drm/panthor/panthor_sched.c static void job_release(struct kref *ref) · line 3921
Quoted 8 lines
drivers/gpu/drm/panthor/panthor_sched.c +1
-1@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);
This also fixes the refcount underflow for me. Thanks!
Quoted 7 lines · Boris Brezillon
After commit
541c8f2468b9("dma-buf: detach fence ops on signal v3"),dma_fence::ops== NULL can't be used to check if the fence is initialized. Usedma_fence_was_initialized()instead.v2:
- Usedma_fence_was_initialized()instead of open-coding it
Quoted 8 lines
Cc Nicolas Frattaroli <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Christian König <[email protected]>Reported-by Steven Price <[email protected]>Reported-by Nicolas Frattaroli <[email protected]>Fixes 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")Signed-off-by Boris Brezillon <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_sched.c +1
-1@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);
Quoted 7 lines · Boris Brezillon
After commit
541c8f2468b9("dma-buf: detach fence ops on signal v3"),dma_fence::ops== NULL can't be used to check if the fence is initialized. Usedma_fence_was_initialized()instead.v2:
- Usedma_fence_was_initialized()instead of open-coding it
Quoted 8 lines
Cc Nicolas Frattaroli <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Christian König <[email protected]>Reported-by Steven Price <[email protected]>Reported-by Nicolas Frattaroli <[email protected]>Fixes 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")Signed-off-by Boris Brezillon <[email protected]>
Best regards,
Liviu
Quoted 20 lines
--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_sched.c +1
-1@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);Signature · 1 line
2.53.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Quoted 7 lines · Boris Brezillon
After commit
541c8f2468b9("dma-buf: detach fence ops on signal v3"),dma_fence::ops== NULL can't be used to check if the fence is initialized. Usedma_fence_was_initialized()instead.v2:
- Usedma_fence_was_initialized()instead of open-coding it
Quoted 8 lines
Cc Nicolas Frattaroli <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Philipp Stanner <[email protected]>Cc Christian König <[email protected]>Reported-by Steven Price <[email protected]>Reported-by Nicolas Frattaroli <[email protected]>Fixes 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")Signed-off-by Boris Brezillon <[email protected]>
Applied to drm-misc-next.
Thanks,
Steve
Quoted 17 lines
--- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panthor/panthor_sched.c +1
-1@@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref)if (job->base.s_fence)drm_sched_job_cleanup (&job->base); -if (job->done_fence && job->done_fence->ops) +if (dma_fence_was_initialized (job->done_fence))dma_fence_put (job->done_fence);else dma_fence_free (job->done_fence);