aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2191-drm-amdkfd-Fix-a-bug-causing-CP-hang-at-process-exit.patch
blob: bfba262833e42c09d3e5ab80d23789e69f72f193 (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
From a4b63c5f5346a759b209b4030caeff0b24192de2 Mon Sep 17 00:00:00 2001
From: Yong Zhao <yong.zhao@amd.com>
Date: Thu, 9 Nov 2017 16:18:04 -0500
Subject: [PATCH 2191/4131] drm/amdkfd: Fix a bug causing CP hang at process
 exit

When HWS is used, flushing tlb at process exit is not needed.

Change-Id: I7b0d51d585bbf75734af94de4cbebb279cc408fe
Signed-off-by: Yong Zhao <yong.zhao@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 9ccd65c..f737e17 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -40,6 +40,7 @@
 struct mm_struct;
 
 #include "kfd_priv.h"
+#include "kfd_device_queue_manager.h"
 #include "kfd_dbgmgr.h"
 
 /*
@@ -358,7 +359,15 @@ static void kfd_process_destroy_pdds(struct kfd_process *p)
 
 	list_for_each_entry_safe(pdd, temp, &p->per_device_data,
 				 per_device_list) {
-		kfd_flush_tlb(pdd->dev, p->pasid);
+		/* In case of HWS, by now pasid:vmid mapping has been invalid,
+		 * so flushing tlb using PACKET3_INVALID_TLBS packet will cause
+		 * CP hang. Moreover, flushing tlb is not needed here as it has
+		 * been done by HWS when pasid:vmid is dissociated.
+		 * In summary, flushing tlb is only needed for non-HWS case.
+		 */
+		if (pdd->dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS)
+			kfd_flush_tlb(pdd->dev, p->pasid);
+
 		/* Destroy the GPUVM VM context */
 		if (pdd->vm)
 			pdd->dev->kfd2kgd->destroy_process_vm(
-- 
2.7.4