aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/2101-drm-amdkfd-Init-evict-restore-work-before-allocating.patch
blob: 3ffb7d9150a764ae317b5f51307798cc2f094605 (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 0cd2b01c4887136e69df5c0aa6f2c354d22acf6d Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Tue, 31 Oct 2017 13:52:37 -0400
Subject: [PATCH 2101/4131] drm/amdkfd: Init evict/restore work before
 allocating memory

The eviction and restore work items must be ready before the first
memory allocations during process creation.

Change-Id: I481df6ef809ff462286b7ac475fd2fc459ce1323
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index b9f7e9a..fab1d59 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -621,6 +621,10 @@ static struct kfd_process *create_process(const struct task_struct *thread,
 	if (err != 0)
 		goto err_init_apertures;
 
+	INIT_DELAYED_WORK(&process->eviction_work.dwork, kfd_evict_bo_worker);
+	INIT_DELAYED_WORK(&process->restore_work, kfd_restore_bo_worker);
+	process->last_restore_timestamp = get_jiffies_64();
+
 	err = kfd_process_reserve_ib_mem(process);
 	if (err)
 		goto err_reserve_ib_mem;
@@ -628,10 +632,6 @@ static struct kfd_process *create_process(const struct task_struct *thread,
 	if (err)
 		goto err_init_cwsr;
 
-	INIT_DELAYED_WORK(&process->eviction_work.dwork, kfd_evict_bo_worker);
-	INIT_DELAYED_WORK(&process->restore_work, kfd_restore_bo_worker);
-	process->last_restore_timestamp = get_jiffies_64();
-
 	/* If PeerDirect interface was not detected try to detect it again
 	 * in case if network driver was loaded later.
 	 */
-- 
2.7.4