Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	Christoph Manszewski <christoph.manszewski@intel.com>,
	Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Subject: [PATCH i-g-t 1/4] tests/xe_eudebug: Keep engine for each client
Date: Fri, 27 Sep 2024 16:53:32 +0300	[thread overview]
Message-ID: <20240927135335.1107326-1-mika.kuoppala@linux.intel.com> (raw)

If we only find hardware engine for first client,
it can be stale for other clients, after we close
the first client, as it was associated through the fd
and we should not trust lib/xe internals how it handles
the engine array.

I found this when trying to track down:

[  132.467616] xe 0000:00:02.0: [drm] *ERROR* Ioctl argument check
failed at drivers/gpu/drm/xe/xe_exec_queue.c:611:
eci[0].gt_id >= xe->info.gt_count

transient error when running xe_eudebug@discovery-empty.
Implying that a provided class_instance was corrupted/stale.

Rediscover the engine for each opened client so that
it points to a proper valid entry for exec_queue_create.

Cc: Christoph Manszewski <christoph.manszewski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
---
 tests/intel/xe_eudebug.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index e28c9ab67..1c90fd16a 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -1007,7 +1007,6 @@ static void test_basic_discovery(int fd, unsigned int flags, bool match_opposite
 #define DISCOVERY_VM_BIND		(1 << 3)
 static void run_discovery_client(struct xe_eudebug_client *c)
 {
-	struct drm_xe_engine_class_instance *hwe = NULL;
 	int fd[RESOURCE_COUNT], i;
 	bool skip_sleep = c->flags & (DISCOVERY_DESTROY_RESOURCES | DISCOVERY_CLOSE_CLIENT);
 	uint64_t addr = 0x1a0000;
@@ -1015,20 +1014,15 @@ static void run_discovery_client(struct xe_eudebug_client *c)
 	srand(getpid());
 
 	for (i = 0; i < RESOURCE_COUNT; i++) {
+		struct drm_xe_engine_class_instance *hwe = NULL;
+
 		fd[i] = xe_eudebug_client_open_driver(c);
 
-		if (!i) {
-			bool found = false;
+		/* Get first */
+		xe_eudebug_for_each_engine(fd[i], hwe)
+			break;
 
-			xe_for_each_engine(fd[0], hwe) {
-				if (hwe->engine_class == DRM_XE_ENGINE_CLASS_COMPUTE ||
-				    hwe->engine_class == DRM_XE_ENGINE_CLASS_RENDER) {
-					found = true;
-					break;
-				}
-			}
-			igt_assert(found);
-		}
+		igt_assert(hwe);
 
 		/*
 		 * Give the debugger a break in event stream after every
-- 
2.34.1


             reply	other threads:[~2024-09-27 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 13:53 Mika Kuoppala [this message]
2024-09-27 13:53 ` [PATCH i-g-t 2/4] tests/xe_eudebug: Detect thread starvation on discovery Mika Kuoppala
2024-09-27 13:53 ` [PATCH i-g-t 3/4] lib/xe_eudebug: Warn on pipe timeouts Mika Kuoppala
2024-09-27 13:53 ` [PATCH i-g-t 4/4] lib/xe_eudebug: Increase default pipe timeout value Mika Kuoppala
2024-09-27 16:12 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/xe_eudebug: Keep engine for each client Patchwork
2024-09-27 16:48 ` ✓ CI.xeBAT: " Patchwork
2024-09-28 13:36 ` ✗ CI.xeFULL: failure " Patchwork
2024-09-28 18:48 ` ✗ 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=20240927135335.1107326-1-mika.kuoppala@linux.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=christoph.manszewski@intel.com \
    --cc=dominik.grzegorzek@intel.com \
    --cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox