Skip to content

Commit b4ce08a

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 7611d7f commit b4ce08a

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

224224
amdgpu_ring_ib_begin(ring);
225225

226-
if (ring->funcs->emit_gfx_shadow)
226+
if (ring->funcs->emit_gfx_shadow && adev->gfx.cp_gfx_shadow)
227227
amdgpu_ring_emit_gfx_shadow(ring, shadow_va, csa_va, gds_va,
228228
init_shadow, vmid);
229229

@@ -279,7 +279,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
279279
fence_flags | AMDGPU_FENCE_FLAG_64BIT);
280280
}
281281

282-
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) {
282+
if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec &&
283+
adev->gfx.cp_gfx_shadow) {
283284
amdgpu_ring_emit_gfx_shadow(ring, 0, 0, 0, false, 0);
284285
amdgpu_ring_init_cond_exec(ring, ring->cond_exe_gpu_addr);
285286
}

0 commit comments

Comments
 (0)