Skip to content

Commit 078377b

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu: Fix cond_exec handling in amdgpu_ib_schedule()
commit b1defcd upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ac251d1 commit 078377b

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
@@ -228,7 +228,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
228228

229229
amdgpu_ring_ib_begin(ring);
230230

231-
if (ring->funcs->emit_gfx_shadow)
231+
if (ring->funcs->emit_gfx_shadow && adev->gfx.cp_gfx_shadow)
232232
amdgpu_ring_emit_gfx_shadow(ring, shadow_va, csa_va, gds_va,
233233
init_shadow, vmid);
234234

@@ -284,7 +284,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
284284
fence_flags | AMDGPU_FENCE_FLAG_64BIT);
285285
}
286286

287-
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) {
287+
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec &&
288+
adev->gfx.cp_gfx_shadow) {
288289
amdgpu_ring_emit_gfx_shadow(ring, 0, 0, 0, false, 0);
289290
amdgpu_ring_init_cond_exec(ring, ring->cond_exe_gpu_addr);
290291
}

0 commit comments

Comments
 (0)