Commit b1defcdc authored by Alex Deucher's avatar Alex Deucher
Browse files

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: c68cbbfd ("drm/amdgpu: cleanup conditional execution")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4789


Reviewed-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ba205ac3)
Cc: stable@vger.kernel.org
parent e7fbff9e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,

	amdgpu_ring_ib_begin(ring);

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

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

	if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) {
	if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec &&
	    adev->gfx.cp_gfx_shadow) {
		amdgpu_ring_emit_gfx_shadow(ring, 0, 0, 0, false, 0);
		amdgpu_ring_init_cond_exec(ring, ring->cond_exe_gpu_addr);
	}