aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1345-drm-amdkfd-Make-unmapping-of-static-queues-condition.patch
blob: 65132869258bdb7550030d48eecc271b9cfb6038 (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
From 9577d7f0f208c1572388494f3c5abecdd535f5d4 Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Mon, 25 Sep 2017 17:38:21 -0400
Subject: [PATCH 1345/4131] drm/amdkfd: Make unmapping of static queues
 conditional

Only unmap static queues in process termination if the process being
terminated is in debugger mode.

Change-Id: I806ad14c789fb19468b1a9cf9a83e04783757d30
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 2d8c238..1abbaa0 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1511,6 +1511,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
 	struct kernel_queue *kq, *kq_next;
 	struct mqd_manager *mqd;
 	struct device_process_node *cur, *next_dpn;
+	bool unmap_static_queues = false;
 
 	retval = 0;
 
@@ -1522,6 +1523,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
 		dqm->queue_count--;
 		qpd->is_debug = false;
 		dqm->total_queue_count--;
+		unmap_static_queues = true;
 	}
 
 	/* Clear all user mode queues */
@@ -1547,7 +1549,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
 		}
 	}
 
-	retval = execute_queues_cpsch(dqm, true);
+	retval = execute_queues_cpsch(dqm, unmap_static_queues);
 	if (retval || qpd->reset_wavefronts) {
 		pr_warn("Resetting wave fronts (cpsch) on dev %p\n", dqm->dev);
 		dbgdev_wave_reset_wavefronts(dqm->dev, qpd->pqm->process);
-- 
2.7.4