aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0616-drm-amdgpu-fix-lockup-when-clean-pending-fences.patch
blob: 084599f88ab311b8178afe86df0165fda84cc0d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 49da68ebc5258c5e8ade9cb9a9ebf06137cbc937 Mon Sep 17 00:00:00 2001
From: Junwei Zhang <Jerry.Zhang@amd.com>
Date: Tue, 13 Oct 2015 11:14:23 +0800
Subject: [PATCH 0616/1050] drm/amdgpu: fix lockup when clean pending fences
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The first lockup fence will lock the fence list of scheduler.
Then cancel the delayed workqueues for all clean pending fences
without waiting the workqueues to finish.

Change-Id: I9bec826de1aa49d587b0662f3fb4a95333979429
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index a413dee..7fa1d7a 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -352,14 +352,14 @@ static void amd_sched_fence_work_func(struct work_struct *work)
 	DRM_ERROR("[%s] scheduler is timeout!\n", sched->name);
 
 	/* Clean all pending fences */
+	spin_lock_irqsave(&sched->fence_list_lock, flags);
 	list_for_each_entry_safe(entity, tmp, &sched->fence_list, list) {
 		DRM_ERROR("  fence no %d\n", entity->base.seqno);
-		cancel_delayed_work_sync(&entity->dwork);
-		spin_lock_irqsave(&sched->fence_list_lock, flags);
+		cancel_delayed_work(&entity->dwork);
 		list_del_init(&entity->list);
-		spin_unlock_irqrestore(&sched->fence_list_lock, flags);
 		fence_put(&entity->base);
 	}
+	spin_unlock_irqrestore(&sched->fence_list_lock, flags);
 }
 
 static int amd_sched_main(void *param)
-- 
1.9.1