Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Zhang <Jesse.Zhang@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	Jesse Zhang <Jesse.Zhang@amd.com>,
	Jesse Zhang <jesse.zhang@amd.com>
Subject: [PATCH] lib/amdgpu: accept GUILTY_RESET from compute/gfx hang slow test
Date: Thu, 11 Jun 2026 16:19:52 +0800	[thread overview]
Message-ID: <20260611082017.937760-1-Jesse.Zhang@amd.com> (raw)

amdgpu_memcpy_dispatch_hang_slow_test() submits a hanging dispatch from
its own context and checks the context reset status via QUERY_STATE.

Newer kernels identify the guilty context and return
AMDGPU_CTX_GUILTY_RESET; older kernels that don't distinguish
guilty/innocent return AMDGPU_CTX_UNKNOWN_RESET. Expect GUILTY_RESET
but also accept UNKNOWN_RESET so the test passes on both.

Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
 lib/amdgpu/compute_utils/amd_dispatch.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/lib/amdgpu/compute_utils/amd_dispatch.c b/lib/amdgpu/compute_utils/amd_dispatch.c
index 138222cde..43ac24959 100644
--- a/lib/amdgpu/compute_utils/amd_dispatch.c
+++ b/lib/amdgpu/compute_utils/amd_dispatch.c
@@ -679,11 +679,16 @@ amdgpu_memcpy_dispatch_hang_slow_test(amdgpu_device_handle device_handle,
 
 		if (!(reset_flags == 0 ||
 			  reset_flags & AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS)) {
-			/* If we're in reset and reset hasn't occurred, then check
-			 * that the hang state is equal to the GPU reset status and
-			 * assert otherwise.
+			/*
+			 * If we're in reset and reset hasn't occurred, check that
+			 * the hung context is reported as reset. Newer kernels
+			 * identify the guilty context and return the expected
+			 * status (AMDGPU_CTX_GUILTY_RESET); older kernels that
+			 * don't distinguish guilty/innocent return
+			 * AMDGPU_CTX_UNKNOWN_RESET. Accept either.
 			 */
-			igt_assert_eq(hang_state, gpu_reset_status_equel);
+			igt_assert(hang_state == gpu_reset_status_equel ||
+				   hang_state == AMDGPU_CTX_UNKNOWN_RESET);
 		}
 
 		r = amdgpu_bo_list_destroy(bo_list);
@@ -769,8 +774,13 @@ amdgpu_dispatch_hang_slow_helper(amdgpu_device_handle device_handle,
 		amdgpu_memcpy_dispatch_test(device_handle, NULL, ip_type,
 					    ring_id, prio, version,
 						BACKEND_SE_GC_SHADER_EXEC_SUCCESS, NULL, userq);
+		/*
+		 * The context that submitted the hanging dispatch owns the
+		 * guilty job, so newer kernels report GUILTY_RESET. Older
+		 * kernels return UNKNOWN_RESET, which the test also accepts.
+		 */
 		amdgpu_memcpy_dispatch_hang_slow_test(device_handle, ip_type,
-						      prio, version, AMDGPU_CTX_UNKNOWN_RESET, userq);
+						      prio, version, AMDGPU_CTX_GUILTY_RESET, userq);
 
 		amdgpu_memcpy_dispatch_test(device_handle, NULL, ip_type, ring_id, prio,
 					    version, BACKEND_SE_GC_SHADER_EXEC_SUCCESS, NULL, userq);
-- 
2.49.0


             reply	other threads:[~2026-06-11  8:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  8:19 Jesse Zhang [this message]
2026-06-11 10:37 ` ✓ Xe.CI.BAT: success for lib/amdgpu: accept GUILTY_RESET from compute/gfx hang slow test Patchwork
2026-06-11 10:53 ` ✓ i915.CI.BAT: " Patchwork
2026-06-11 19:50 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-12  7:30 ` ✓ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611082017.937760-1-Jesse.Zhang@amd.com \
    --to=jesse.zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=vitaly.prosyak@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox