fix memory leak. This reverts commit d6951b49faa8447a6a77cdb1ef3346b1a1786d31. because when entity_fini is interrupted the jobs in queue still not processed with job_begin, so the finish_cb is not hooked on sched fence, we still need manually do cleanups. Change-Id: I6e17bfeeac85062bc52f1d51b9697852b084845c --- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 6f041e8..7aa6455 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -231,10 +231,11 @@ void amd_sched_entity_fini(struct amd_gpu_scheduler *sched, kthread_unpark(sched->thread); while ((job = to_amd_sched_job(spsc_queue_pop(&entity->job_queue)))) { struct amd_sched_fence *s_fence = job->s_fence; - amd_sched_fence_scheduled(s_fence); dma_fence_set_error(&s_fence->finished, -ESRCH); amd_sched_fence_finished(s_fence); + dma_fence_put(&s_fence->finished); + sched->ops->free_job(job); } } } -- 2.7.4