drm/amdgpu: avoid using invalidate semaphore for picasso
authorchangzhu <Changfeng.Zhu@amd.com>
Tue, 10 Dec 2019 02:23:09 +0000 (10:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 10:05:21 +0000 (11:05 +0100)
commit 413fc385a594ea6eb08843be33939057ddfdae76 upstream.

It may cause timeout waiting for sem acquire in VM flush when using
invalidate semaphore for picasso. So it needs to avoid using invalidate
semaphore for piasso.

Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 5d9b2ee019e3a972322ba6cb7459a938180e348b..262ff5f045ca871f154fbe7b1ca580dcf92765fb 100644 (file)
@@ -500,8 +500,11 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
         */
 
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
-       if (vmhub == AMDGPU_MMHUB_0 ||
-           vmhub == AMDGPU_MMHUB_1) {
+       if ((vmhub == AMDGPU_MMHUB_0 ||
+            vmhub == AMDGPU_MMHUB_1) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8))) {
                for (j = 0; j < adev->usec_timeout; j++) {
                        /* a read return value of 1 means semaphore acuqire */
                        tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng);
@@ -531,8 +534,11 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
        }
 
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
-       if (vmhub == AMDGPU_MMHUB_0 ||
-           vmhub == AMDGPU_MMHUB_1)
+       if ((vmhub == AMDGPU_MMHUB_0 ||
+            vmhub == AMDGPU_MMHUB_1) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release
@@ -563,8 +569,11 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
         */
 
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
-       if (ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
-           ring->funcs->vmhub == AMDGPU_MMHUB_1)
+       if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
+            ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /* a read return value of 1 means semaphore acuqire */
                amdgpu_ring_emit_reg_wait(ring,
                                          hub->vm_inv_eng0_sem + eng, 0x1, 0x1);
@@ -580,8 +589,11 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
                                            req, 1 << vmid);
 
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
-       if (ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
-           ring->funcs->vmhub == AMDGPU_MMHUB_1)
+       if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
+            ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release