When the sched thread is parked we assume ring_mirror_list is
not accessed from here.

Signed-off-by: Andrey Grodzovsky <andrey.grodzov...@amd.com>
Reviewed-by: Christian König <christian.koe...@amd.com>
---
 drivers/gpu/drm/scheduler/sched_main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index d4cc728..6774955 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -635,9 +635,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
        struct drm_sched_job *job;
        unsigned long flags;
 
-       /* Don't destroy jobs while the timeout worker is running */
-       if (sched->timeout != MAX_SCHEDULE_TIMEOUT &&
-           !cancel_delayed_work(&sched->work_tdr))
+       /*
+       * Don't destroy jobs while the timeout worker is running  OR thread
+       * 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;
 
        spin_lock_irqsave(&sched->job_list_lock, flags);
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to