[PATCH v3 11/13] drm/sched: Waiting for pending jobs to complete in scheduler kill
Boris Brezillon
boris.brezillon at collabora.com
Tue Sep 12 10:28:28 UTC 2023
On Mon, 11 Sep 2023 19:16:13 -0700
Matthew Brost <matthew.brost at intel.com> wrote:
> +void drm_sched_add_pending_job(struct drm_sched_job *job, bool tail)
> +{
> + struct drm_gpu_scheduler *sched = job->sched;
> + struct drm_sched_entity *entity = job->entity;
drm_sched_entity_pop_job() sets job->entity to NULL [1], and I end with
a NULL deref in this function. I guess you have another patch in your
tree dropping this job->entity = NULL in drm_sched_entity_pop_job(),
but given this comment [1], it's probably not the right thing to do.
> +
> + lockdep_assert_held(&sched->job_list_lock);
> +
> + if (tail)
> + list_add_tail(&job->list, &sched->pending_list);
> + else
> + list_add(&job->list, &sched->pending_list);
> + if (!entity->pending_job_count++)
> + reinit_completion(&entity->jobs_done);
> +}
> +EXPORT_SYMBOL(drm_sched_add_pending_job);
[1]https://elixir.bootlin.com/linux/v6.6-rc1/source/drivers/gpu/drm/scheduler/sched_entity.c#L497
More information about the dri-devel
mailing list