]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: clear set_q_mode_offs when VM changed
authorZhenGuo Yin <zhenguo.yin@amd.com>
Tue, 2 Apr 2024 03:41:05 +0000 (11:41 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 03:27:58 +0000 (23:27 -0400)
[Why]
set_q_mode_offs don't get cleared after GPU reset, nexting SET_Q_MODE
packet to init shadow memory will be skiped, hence there has a page fault.

[How]
VM flush is needed after GPU reset, clear set_q_mode_offs when
emitting VM flush.

Fixes: 8bc75586ea01 ("drm/amdgpu: workaround to avoid SET_Q_MODE packets v2")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

index 1770e496c1b7ce21198fdb80d3051c4c961e9b5f..2c82e27416190a69c39a9041cc1203851a9843e0 100644 (file)
@@ -5465,6 +5465,7 @@ static void gfx_v11_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
        /* Make sure that we can't skip the SET_Q_MODE packets when the VM
         * changed in any way.
         */
+       ring->set_q_mode_offs = 0;
        ring->set_q_mode_ptr = NULL;
 }