* Guilty job did complete and hence needs to be manually removed
* See drm_sched_stop doc.
*/
- if (list_empty(&job->node))
+ if (sched->free_guilty) {
job->sched->ops->free_job(job);
+ sched->free_guilty = false;
+ }
spin_lock_irqsave(&sched->job_list_lock, flags);
drm_sched_start_timeout(sched);
/*
* We must keep bad job alive for later use during
- * recovery by some of the drivers
+ * recovery by some of the drivers but leave a hint
+ * that the guilty job must be released.
*/
if (bad != s_job)
sched->ops->free_job(s_job);
+ else
+ sched->free_guilty = true;
}
}
* guilty and it will be considered for scheduling further.
* @num_jobs: the number of jobs in queue in the scheduler
* @ready: marks if the underlying HW is ready to work
+ * @free_guilty: A hit to time out handler to free the guilty job.
*
* One scheduler is implemented for each hardware ring.
*/
int hang_limit;
atomic_t num_jobs;
bool ready;
+ bool free_guilty;
};
int drm_sched_init(struct drm_gpu_scheduler *sched,