aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1764-drm-amdgpu-Fix-recursive-evict-restore-worker-on-a-m.patch
blob: b7164bdf1501be038a1fdd49e935ca2df6e2aa73 (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
45
From ccd8b3a0eda53f434ff634b2babff0264975741f Mon Sep 17 00:00:00 2001
From: Shaoyun Liu <Shaoyun.Liu@amd.com>
Date: Fri, 4 Aug 2017 18:44:20 -0400
Subject: [PATCH 1764/4131] drm/amdgpu: Fix recursive evict/restore worker on a
 multiple mapped bo

When one buffer object is mapped muliple times, KFD will treat them as
different memory object but share the same ttm_bo with a single eviction
fence. Separate the ttm_bo_wait and attach eviction fence code to avoid
ttm_bo_wait trigger the eviction worker on the bo that just be assigned
with the eviction fence

Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>

Change-Id: I4a7dba32c21cbd5fc77512c0476b8d2b4b6ea155
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 764585f..80b5197 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -2368,12 +2368,12 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info)
 
 	/* Wait for validate to finish and attach new eviction fence */
 	list_for_each_entry(mem, &process_info->kfd_bo_list,
-		validate_list.head) {
-		struct amdgpu_bo *bo = mem->bo;
-
-		ttm_bo_wait(&bo->tbo, false, false);
-		amdgpu_bo_fence(bo, &process_info->eviction_fence->base, true);
-	}
+		validate_list.head)
+		ttm_bo_wait(&mem->bo->tbo, false, false);
+	list_for_each_entry(mem, &process_info->kfd_bo_list,
+		validate_list.head)
+		amdgpu_bo_fence(mem->bo,
+			&process_info->eviction_fence->base, true);
 
 	/* Attach eviction fence to PD / PT BOs */
 	list_for_each_entry(peer_vm, &process_info->vm_list_head,
-- 
2.7.4