[PATCH v4 10/17] drm/panfrost: Don't cancel a job that completed during a reset

From: Arun Iyengar via B4 Relay

Date: Thu Nov 26 2026 - 04:38:03 EST


From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

A job that completes during panfrost_reset() has its jc cleared, so
drm_sched_start() cancels it. Return its done fence instead. Depends
on the previous patch. Not reproduced.

Fixes: 03877d621db0 ("drm/scheduler: mark jobs without fence as canceled")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/sashiko-outbox-206581@xxxxxxxxxx/
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
v4: shorter commit message.
---
drivers/gpu/drm/panfrost/panfrost_job.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index c9bd3555f..a64c33047 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -409,11 +409,9 @@ static struct dma_fence *panfrost_job_run(struct drm_sched_job *sched_job)
if (unlikely(job->base.s_fence->finished.error))
return NULL;

- /* Nothing to execute: can happen if the job has finished while
- * we were resetting the GPU.
- */
+ /* Done in the reset: drm_sched_start() cancels it without a fence */
if (!job->jc)
- return NULL;
+ return dma_fence_get(job->done_fence);

fence = panfrost_fence_create(pfdev, slot);
if (IS_ERR(fence))

--
2.55.0