aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch
new file mode 100644
index 00000000..e320bde0
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1876-drm-amdgpu-drop-the-busy-wait-for-GMC-v9-TLB-invalid.patch
@@ -0,0 +1,65 @@
+From d01ac318ae227edb4db3c9bbd599cd62b20f3308 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Thu, 25 Oct 2018 10:50:42 +0200
+Subject: [PATCH 1876/2940] drm/amdgpu: drop the busy wait for GMC v9 TLB
+ invalidations
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This code is not performance critical.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Emily Deng <Emily.Deng@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 26 ++++----------------------
+ 1 file changed, 4 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+index af3d0bb07eb8..27832660ee02 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+@@ -430,35 +430,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,
+ }
+
+ spin_lock(&adev->gmc.invalidate_lock);
+-
+ WREG32_NO_KIQ(hub->vm_inv_eng0_req + eng, tmp);
+-
+- /* Busy wait for ACK.*/
+- for (j = 0; j < 100; j++) {
+- tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
+- tmp &= 1 << vmid;
+- if (tmp)
+- break;
+- cpu_relax();
+- }
+- if (j < 100) {
+- spin_unlock(&adev->gmc.invalidate_lock);
+- continue;
+- }
+-
+- /* Wait for ACK with a delay.*/
+ for (j = 0; j < adev->usec_timeout; j++) {
+ tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
+- tmp &= 1 << vmid;
+- if (tmp)
++ if (tmp & (1 << vmid))
+ break;
+ udelay(1);
+ }
+- if (j < adev->usec_timeout) {
+- spin_unlock(&adev->gmc.invalidate_lock);
+- continue;
+- }
+ spin_unlock(&adev->gmc.invalidate_lock);
++ if (j < adev->usec_timeout)
++ continue;
++
+ DRM_ERROR("Timeout waiting for VM flush ACK!\n");
+ }
+ }
+--
+2.17.1
+