From e4fc3de3e787ce7a71da1f14bf2ee849530aac2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 11 Jun 2016 18:12:39 +0200 Subject: [PATCH] drm/amdgpu: don't hold spin lock while cancelling delayed work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a lock recursion that was observed since commit "drm/amdgpu: fix and cleanup job destruction". Other related problems still need to be understood. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96445 Suggested-by: Christian König Signed-off-by: Nicolai Hähnle --- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 2425172..25312169 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -329,14 +329,15 @@ static void amd_sched_job_finish(struct work_struct *work) struct amd_gpu_scheduler *sched = s_job->sched; unsigned long flags; + if (sched->timeout != MAX_SCHEDULE_TIMEOUT) + cancel_delayed_work_sync(&s_job->work_tdr); + /* remove job from ring_mirror_list */ spin_lock_irqsave(&sched->job_list_lock, flags); list_del_init(&s_job->node); if (sched->timeout != MAX_SCHEDULE_TIMEOUT) { struct amd_sched_job *next; - cancel_delayed_work_sync(&s_job->work_tdr); - /* queue TDR for next job */ next = list_first_entry_or_null(&sched->ring_mirror_list, struct amd_sched_job, node); -- 2.7.4