All of lore.kernel.org
 help / color / mirror / Atom feed
From: John.C.Harrison@Intel.com
To: IGT-Dev@Lists.FreeDesktop.Org
Cc: Intel-GFX@Lists.FreeDesktop.Org
Subject: [Intel-gfx] [PATCH i-g-t 04/11] tests/i915/i915_hangman: Explicitly test per engine reset vs full GPU reset
Date: Mon, 13 Dec 2021 15:29:07 -0800	[thread overview]
Message-ID: <20211213232914.2523139-5-John.C.Harrison@Intel.com> (raw)
In-Reply-To: <20211213232914.2523139-1-John.C.Harrison@Intel.com>

From: John Harrison <John.C.Harrison@Intel.com>

Although the hangman test was ensuring that *some* reset functionality
was enabled, it did not differentiate what kind. The infrastructure
required to choose between per engine reset or full GT reset was
recently added. So update this test to use it as well.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 tests/i915/i915_hangman.c | 77 +++++++++++++++++++++++++--------------
 1 file changed, 50 insertions(+), 27 deletions(-)

diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index bd787d7b4..f8a48337c 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -323,40 +323,26 @@ static void hangcheck_unterminated(const intel_ctx_t *ctx)
 	}
 }
 
-igt_main
+static void do_tests(const char *name, const char *prefix,
+		     const intel_ctx_t *ctx)
 {
 	const struct intel_execution_engine2 *e;
-	const intel_ctx_t *ctx;
-	igt_hang_t hang = {};
-
-	igt_fixture {
-		device = drm_open_driver(DRIVER_INTEL);
-		igt_require_gem(device);
-
-		ctx = intel_ctx_create_all_physical(device);
-
-		hang = igt_allow_hang(device, ctx->id, HANG_ALLOW_CAPTURE);
-
-		sysfs = igt_sysfs_open(device);
-		igt_assert(sysfs != -1);
+	char buff[256];
 
-		igt_require(has_error_state(sysfs));
-	}
-
-	igt_describe("Basic error capture");
-	igt_subtest("error-state-basic")
-		test_error_state_basic();
-
-	igt_describe("Per engine error capture");
-	igt_subtest_with_dynamic("error-state-capture") {
+	snprintf(buff, sizeof(buff), "Per engine error capture (%s reset)", name);
+	igt_describe(buff);
+	snprintf(buff, sizeof(buff), "%s-error-state-capture", prefix);
+	igt_subtest_with_dynamic(buff) {
 		for_each_ctx_engine(device, ctx, e) {
 			igt_dynamic_f("%s", e->name)
 				test_error_state_capture(ctx, e);
 		}
 	}
 
-	igt_describe("Per engine hang recovery (spin)");
-	igt_subtest_with_dynamic("engine-hang") {
+	snprintf(buff, sizeof(buff), "Per engine hang recovery (spin, %s reset)", name);
+	igt_describe(buff);
+	snprintf(buff, sizeof(buff), "%s-engine-hang", prefix);
+	igt_subtest_with_dynamic(buff) {
                 int has_gpu_reset = 0;
 		struct drm_i915_getparam gp = {
 			.param = I915_PARAM_HAS_GPU_RESET,
@@ -374,8 +360,10 @@ igt_main
 		}
 	}
 
-	igt_describe("Per engine hang recovery (invalid CS)");
-	igt_subtest_with_dynamic("engine-error") {
+	snprintf(buff, sizeof(buff), "Per engine hang recovery (invalid CS, %s reset)", name);
+	igt_describe(buff);
+	snprintf(buff, sizeof(buff), "%s-engine-error", prefix);
+	igt_subtest_with_dynamic(buff) {
 		int has_gpu_reset = 0;
 		struct drm_i915_getparam gp = {
 			.param = I915_PARAM_HAS_GPU_RESET,
@@ -391,11 +379,46 @@ igt_main
 				test_engine_hang(ctx, e, IGT_SPIN_INVALID_CS);
 		}
 	}
+}
+
+igt_main
+{
+	const intel_ctx_t *ctx;
+	igt_hang_t hang = {};
+
+	igt_fixture {
+		device = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(device);
+
+		ctx = intel_ctx_create_all_physical(device);
+
+		hang = igt_allow_hang(device, ctx->id, HANG_ALLOW_CAPTURE);
+
+		sysfs = igt_sysfs_open(device);
+		igt_assert(sysfs != -1);
+
+		igt_require(has_error_state(sysfs));
+	}
+
+	igt_describe("Basic error capture");
+	igt_subtest("error-state-basic")
+		test_error_state_basic();
+
 
 	igt_describe("Check that executing unintialised memory causes a hang");
 	igt_subtest("hangcheck-unterminated")
 		hangcheck_unterminated(ctx);
 
+	do_tests("GT", "gt", ctx);
+
+	igt_fixture {
+		igt_disallow_hang(device, hang);
+
+		hang = igt_allow_hang(device, ctx->id, HANG_ALLOW_CAPTURE | HANG_WANT_ENGINE_RESET);
+	}
+
+	do_tests("engine", "engine", ctx);
+
 	igt_fixture {
 		igt_disallow_hang(device, hang);
 		intel_ctx_destroy(device, ctx);
-- 
2.25.1


  parent reply	other threads:[~2021-12-13 23:29 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 23:29 [Intel-gfx] [PATCH i-g-t 00/11] Fixes for i915_hangman and gem_exec_capture John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 01/11] tests/i915/i915_hangman: Add descriptions John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-14  9:47   ` [Intel-gfx] " Petri Latvala
2021-12-14  9:47     ` Petri Latvala
2021-12-14 15:38     ` [Intel-gfx] " John Harrison
2021-12-14 15:38       ` John Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 02/11] lib/hang: Fix igt_require_hang_ring to work with all engines John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 03/11] tests/i915/i915_hangman: Update capture test to use engine structure John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-13 23:29 ` John.C.Harrison [this message]
2021-12-21 11:28   ` [Intel-gfx] [igt-dev] [PATCH i-g-t 04/11] tests/i915/i915_hangman: Explicitly test per engine reset vs full GPU reset Dandamudi, Priyanka
2021-12-21 11:28     ` Dandamudi, Priyanka
2021-12-22  1:21     ` [Intel-gfx] " John Harrison
2021-12-22  1:21       ` John Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 05/11] tests/i915/i915_hangman: Add uevent test & fix detector John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 06/11] tests/i915/i915_hangman: Use the correct context in hangcheck_unterminated John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 07/11] tests/i915/i915_hangman: Add alive-ness test after error capture John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-16  7:23   ` [Intel-gfx] " Zbigniew Kempczyński
2021-12-16 20:59     ` John Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 08/11] lib/store: Refactor common store code into helper function John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-16  7:46   ` [Intel-gfx] " Zbigniew Kempczyński
2021-12-16  7:46     ` Zbigniew Kempczyński
2021-12-16 22:40     ` [Intel-gfx] " John Harrison
2021-12-16 22:40       ` John Harrison
2021-12-20 18:13       ` [Intel-gfx] " Zbigniew Kempczyński
2021-12-22  2:22         ` John Harrison
2021-12-22  2:22           ` John Harrison
2021-12-27  6:02           ` [Intel-gfx] " Zbigniew Kempczyński
2021-12-27  6:02             ` Zbigniew Kempczyński
2022-01-13  4:05             ` [Intel-gfx] " John Harrison
2022-01-13  4:05               ` John Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 09/11] tests/i915/i915_hangman: Remove reliance on context persistance John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 10/11] tests/i915/i915_hangman: Run background task on all engines John.C.Harrison
2021-12-13 23:29   ` [igt-dev] " John.C.Harrison
2021-12-13 23:29 ` [Intel-gfx] [PATCH i-g-t 11/11] tests/i915/gem_exec_fence: Configure correct context John.C.Harrison
2021-12-14  0:14 ` [igt-dev] ✓ Fi.CI.BAT: success for Fixes for i915_hangman and gem_exec_capture Patchwork
2021-12-14  8:11 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-12-21 12:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Fixes for i915_hangman and gem_exec_capture (rev2) Patchwork
2021-12-21 13:12 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20211213232914.2523139-5-John.C.Harrison@Intel.com \
    --to=john.c.harrison@intel.com \
    --cc=IGT-Dev@Lists.FreeDesktop.Org \
    --cc=Intel-GFX@Lists.FreeDesktop.Org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.