From: Arun Iyengar <[email protected]>

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: [email protected]
Reported-by: Sashiko <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Arun Iyengar <[email protected]>
---
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


Reply via email to