Commit 2b6f717c authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/sched: Avoid job cleanup if sched thread is parked.

When the sched thread is parked we assume ring_mirror_list is
not accessed from here.
Signed-off-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7c55adb0
...@@ -650,9 +650,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) ...@@ -650,9 +650,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
struct drm_sched_job *job; struct drm_sched_job *job;
unsigned long flags; unsigned long flags;
/* Don't destroy jobs while the timeout worker is running */ /*
if (sched->timeout != MAX_SCHEDULE_TIMEOUT && * Don't destroy jobs while the timeout worker is running OR thread
!cancel_delayed_work(&sched->work_tdr)) * is being parked and hence assumed to not touch ring_mirror_list
*/
if ((sched->timeout != MAX_SCHEDULE_TIMEOUT &&
!cancel_delayed_work(&sched->work_tdr)) ||
__kthread_should_park(sched->thread))
return NULL; return NULL;
spin_lock_irqsave(&sched->job_list_lock, flags); spin_lock_irqsave(&sched->job_list_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment