Skip to content

Commit b1defcd

Browse files
committed
drm/amdgpu: Fix cond_exec handling in amdgpu_ib_schedule()
The EXEC_COUNT field must be > 0. In the gfx shadow handling we always emit a cond_exec packet after the gfx_shadow packet, but the EXEC_COUNT never gets patched. This leads to a hang when we try and reset queues on gfx11 APUs. Fixes: c68cbbf ("drm/amdgpu: cleanup conditional execution") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4789 Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit ba205ac) Cc: stable@vger.kernel.org
1 parent e7fbff9 commit b1defcd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
235235

236236
amdgpu_ring_ib_begin(ring);
237237

238-
if (ring->funcs->emit_gfx_shadow)
238+
if (ring->funcs->emit_gfx_shadow && adev->gfx.cp_gfx_shadow)
239239
amdgpu_ring_emit_gfx_shadow(ring, shadow_va, csa_va, gds_va,
240240
init_shadow, vmid);
241241

@@ -291,7 +291,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
291291
fence_flags | AMDGPU_FENCE_FLAG_64BIT);
292292
}
293293

294-
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) {
294+
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec &&
295+
adev->gfx.cp_gfx_shadow) {
295296
amdgpu_ring_emit_gfx_shadow(ring, 0, 0, 0, false, 0);
296297
amdgpu_ring_init_cond_exec(ring, ring->cond_exe_gpu_addr);
297298
}

0 commit comments

Comments
 (0)