aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-10-25 04:50:42 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-11-05 15:49:40 -0500
commit396557b03c9466f27b60052c6b364541f61092db (patch)
tree10a38e9ee9e0feacbe67c0b7057f6ed3c583b92f /drivers
parentaf5fe1e96aa156886f89282371fce1629fcc9f6a (diff)
drm/amdgpu: drop the busy wait for GMC v9 TLB invalidations
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c26
1 files 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 4845b6af5808..14ca4d835e0b 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -350,35 +350,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,
350 } 350 }
351 351
352 spin_lock(&adev->gmc.invalidate_lock); 352 spin_lock(&adev->gmc.invalidate_lock);
353
354 WREG32_NO_KIQ(hub->vm_inv_eng0_req + eng, tmp); 353 WREG32_NO_KIQ(hub->vm_inv_eng0_req + eng, tmp);
355
356 /* Busy wait for ACK.*/
357 for (j = 0; j < 100; j++) {
358 tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
359 tmp &= 1 << vmid;
360 if (tmp)
361 break;
362 cpu_relax();
363 }
364 if (j < 100) {
365 spin_unlock(&adev->gmc.invalidate_lock);
366 continue;
367 }
368
369 /* Wait for ACK with a delay.*/
370 for (j = 0; j < adev->usec_timeout; j++) { 354 for (j = 0; j < adev->usec_timeout; j++) {
371 tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng); 355 tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + eng);
372 tmp &= 1 << vmid; 356 if (tmp & (1 << vmid))
373 if (tmp)
374 break; 357 break;
375 udelay(1); 358 udelay(1);
376 } 359 }
377 if (j < adev->usec_timeout) {
378 spin_unlock(&adev->gmc.invalidate_lock);
379 continue;
380 }
381 spin_unlock(&adev->gmc.invalidate_lock); 360 spin_unlock(&adev->gmc.invalidate_lock);
361 if (j < adev->usec_timeout)
362 continue;
363
382 DRM_ERROR("Timeout waiting for VM flush ACK!\n"); 364 DRM_ERROR("Timeout waiting for VM flush ACK!\n");
383 } 365 }
384} 366}