[PATCH 1/2] lib/amdgpu: fix SDMA packet contents for deadlock helper

Alex Deucher alexdeucher at gmail.com
Wed Jun 25 14:06:16 UTC 2025


+ Vitalty, Jesse

On Wed, Jun 25, 2025 at 12:28 AM Alex Deucher <alexander.deucher at amd.com> wrote:
>
> Use the right NOP packet for SDMA and set the retry
> to infinite.  If it's set to 0, the engine gives up
> after the first try.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  lib/amdgpu/amd_deadlock_helpers.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/lib/amdgpu/amd_deadlock_helpers.c b/lib/amdgpu/amd_deadlock_helpers.c
> index 3b4822ca0..0cd83f061 100644
> --- a/lib/amdgpu/amd_deadlock_helpers.c
> +++ b/lib/amdgpu/amd_deadlock_helpers.c
> @@ -101,8 +101,14 @@ amdgpu_wait_memory(amdgpu_device_handle device_handle, unsigned int ip_type, uin
>
>         base_cmd->emit(base_cmd, 0);/* reference value */
>         base_cmd->emit(base_cmd, 0xffffffff); /* and mask */
> -       base_cmd->emit(base_cmd, 0x00000004);/* poll interval */
> -       base_cmd->emit_repeat(base_cmd, GFX_COMPUTE_NOP, 16 - base_cmd->cdw);
> +
> +       if (ip_type == AMDGPU_HW_IP_DMA) {
> +               base_cmd->emit(base_cmd, 0x0fff0004);/* poll interval and infinite retry */
> +               base_cmd->emit_repeat(base_cmd, SDMA_NOP, 16 - base_cmd->cdw);
> +       } else {
> +               base_cmd->emit(base_cmd, 0x00000004);/* poll interval */
> +               base_cmd->emit_repeat(base_cmd, GFX_COMPUTE_NOP, 16 - base_cmd->cdw);
> +       }
>
>         ib_result_cpu2 = ib_result_cpu;
>         ib_result_cpu2[MEMORY_OFFSET] = 0x0; /* the memory we wait on to change */
> --
> 2.49.0
>


More information about the igt-dev mailing list