drm/amdgpu: fix gfx VF FLR test fail on navi
authorHaiJun Chang <HaiJun.Chang@amd.com>
Tue, 29 Oct 2019 07:44:08 +0000 (15:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Oct 2019 15:07:13 +0000 (11:07 -0400)
Cp wptr in wb buffer is outdated after VF FLR.
The outdated wptr may cause cp to execute unexpected packets.
Reset cp wptr in wb buffer.

Signed-off-by: HaiJun Chang <HaiJun.Chang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

index 959f5be..e7bab4f 100644 (file)
@@ -3106,6 +3106,7 @@ static int gfx_v10_0_gfx_init_queue(struct amdgpu_ring *ring)
                        memcpy(mqd, adev->gfx.me.mqd_backup[AMDGPU_MAX_GFX_RINGS], sizeof(*mqd));
                /* reset the ring */
                ring->wptr = 0;
+               adev->wb.wb[ring->wptr_offs] = 0;
                amdgpu_ring_clear_ring(ring);
 #ifdef BRING_UP_DEBUG
                mutex_lock(&adev->srbm_mutex);