]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Revert "drm/amdgpu/gfx8: Fix compute ring failure after resetting"
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Wed, 24 Jan 2018 13:52:26 +0000 (08:52 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:19:12 +0000 (14:19 -0500)
This reverts commit 75737cb4eb78c7f185e4700b4aa20cf7a3381aca.

Fixes compute rings test failure on bare metal during full GPU reset.

RCA:
the ring buffer has to be filled with valid packets (such as NOPs) first
before submitting MAP_QUEUEs packet into KIQ. Once a compute engine is mapped,
it will immediately execute the ring buffer if the RTPR is not equal to the
WTPR from the MQD. It could lead to engine hang if the ring buffer filled
with random data.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

index 1207f361f28b64b2abdbc22eae7819bf5dfb7969..8a65b5327a024ac9a4d0a2461e46e089d94d73e6 100644 (file)
@@ -4847,6 +4847,9 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct vi_mqd_allocation));
+               /* reset ring buffer */
+               ring->wptr = 0;
+               amdgpu_ring_clear_ring(ring);
        } else {
                amdgpu_ring_clear_ring(ring);
        }
@@ -4921,13 +4924,6 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
        /* Test KCQs */
        for (i = 0; i < adev->gfx.num_compute_rings; i++) {
                ring = &adev->gfx.compute_ring[i];
-               if (adev->in_gpu_reset) {
-                       /* move reset ring buffer to here to workaround
-                        * compute ring test failed
-                        */
-                       ring->wptr = 0;
-                       amdgpu_ring_clear_ring(ring);
-               }
                ring->ready = true;
                r = amdgpu_ring_test_ring(ring);
                if (r)