dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked.
@ 2019-11-25 14:10 Andrey Grodzovsky
  2019-11-25 14:10 ` Andrey Grodzovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andrey Grodzovsky @ 2019-11-25 14:10 UTC (permalink / raw)
  Cc: Emily.Deng-5C7GfCeVMHo, Andrey Grodzovsky,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Christian.Koenig-5C7GfCeVMHo

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

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-11-27 15:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-25 14:10 [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked Andrey Grodzovsky
2019-11-25 14:10 ` Andrey Grodzovsky
2019-11-25 14:10 ` [PATCH v3 2/2] drm/scheduler: Avoid accessing freed bad job Andrey Grodzovsky
2019-11-25 14:10   ` Andrey Grodzovsky
     [not found]   ` <1574691041-5499-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-11-25 16:57     ` Steven Price
2019-11-25 16:57       ` Steven Price
2019-11-25 16:51 ` [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked Steven Price
2019-11-26  9:08   ` Christian König
2019-11-26 15:36     ` Andrey Grodzovsky
2019-11-27 15:32       ` Andrey Grodzovsky
     [not found]         ` <b3835ff0-15f0-ead4-0255-3d93fc560c77-5C7GfCeVMHo@public.gmane.org>
2019-11-27 15:35           ` Christian König
2019-11-27 15:35             ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox