aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3310-drm-amdgpu-Ignore-TLB-flush-before-vmid-allocate.patch
blob: 4118a3fc6e04e960da892f675265a6694e716d77 (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
From fe92a893038b135e92ad152b1a6ea9971c3ea156 Mon Sep 17 00:00:00 2001
From: Oak Zeng <Oak.Zeng@amd.com>
Date: Fri, 26 Jan 2018 13:56:24 -0500
Subject: [PATCH 3310/4131] drm/amdgpu: Ignore TLB flush before vmid allocate

Change-Id: I7309e111ebf46b73e9986187887c13642143b486
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 7bddeb6..6e3043c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -1183,7 +1183,13 @@ void kfd_flush_tlb(struct kfd_dev *dev, struct kfd_process *p)
 			return;
 		}
 
-		f2g->invalidate_tlbs_vmid(dev->kgd, pdd->qpd.vmid);
+		/* vmid allocation is delayed to the creation of the first
+		 * queue of the process. For buffers allocated and mapped
+		 * before queue creation, vmid is still no allocated (valued 0).
+		 * Ignore tlb invalidation request for this case.
+		 */
+		if (pdd->qpd.vmid)
+			f2g->invalidate_tlbs_vmid(dev->kgd, pdd->qpd.vmid);
 	} else
 		f2g->invalidate_tlbs(dev->kgd, p->pasid);
 }
-- 
2.7.4