aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1667-drm-amdkfd-Rename-a-variable-to-avoid-confusion.patch
blob: 3b61b82f1ff0b60ca24ef255eaab76edfa2f584e (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 0e8b2a980e1fcc6cd660197b92f63adb5b2c5b3e Mon Sep 17 00:00:00 2001
From: Yong Zhao <Yong.Zhao@amd.com>
Date: Wed, 26 Apr 2017 15:39:38 -0400
Subject: [PATCH 1667/4131] drm/amdkfd: Rename a variable to avoid confusion

Eviction_fence is both used in struct amdkfd_process_info and
struct kfd_eviction_work, which causes unnecessary confusion.
Rename the one in struct kfd_eviction_work to quiesce_fence.

Change-Id: I3900cd04778ad2e1628007e7adede272a5d7eee9
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 10 +++++-----
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h   |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index acb9c2e..b84dddb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -920,16 +920,16 @@ int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm,
 		 * process to be evicted. Check if the fence is same which
 		 * indicates that previous work item scheduled is not completed
 		 */
-		if (p->eviction_work.eviction_fence == fence)
+		if (p->eviction_work.quiesce_fence == fence)
 			goto out;
 		else {
 			WARN(1, "Starting new evict with previous evict is not completed\n");
 			if (cancel_delayed_work_sync(&p->eviction_work.dwork))
-				fence_put(p->eviction_work.eviction_fence);
+				fence_put(p->eviction_work.quiesce_fence);
 		}
 	}
 
-	p->eviction_work.eviction_fence = fence_get(fence);
+	p->eviction_work.quiesce_fence = fence_get(fence);
 
 	/* Avoid KFD process starvation. Wait for at least
 	 * PROCESS_ACTIVE_TIME_MS before evicting the process again
@@ -976,13 +976,13 @@ void kfd_evict_bo_worker(struct work_struct *work)
 	pr_info("Started evicting process of pasid %d\n", p->pasid);
 	ret = quiesce_process_mm(p);
 	if (!ret) {
-		fence_signal(eviction_work->eviction_fence);
+		fence_signal(eviction_work->quiesce_fence);
 		schedule_delayed_work(&p->restore_work,
 					PROCESS_RESTORE_TIME_MS);
 	} else
 		pr_err("Failed to quiesce user queues. Cannot evict BOs\n");
 
-	fence_put(eviction_work->eviction_fence);
+	fence_put(eviction_work->quiesce_fence);
 
 	pr_info("Finished evicting process of pasid %d\n", p->pasid);
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 626ffbd..66d1c1b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -577,7 +577,7 @@ struct qcm_process_device {
 /* KFD Memory Eviction */
 struct kfd_eviction_work {
 	struct delayed_work dwork;
-	struct fence *eviction_fence;
+	struct fence *quiesce_fence;
 };
 
 /* Approx. wait time before attempting to restore evicted BOs */
-- 
2.7.4