Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/4] tests/xe_eudebug: Keep engine for each client
@ 2024-09-27 13:53 Mika Kuoppala
  2024-09-27 13:53 ` [PATCH i-g-t 2/4] tests/xe_eudebug: Detect thread starvation on discovery Mika Kuoppala
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Mika Kuoppala @ 2024-09-27 13:53 UTC (permalink / raw)
  To: igt-dev; +Cc: Mika Kuoppala, Christoph Manszewski, Dominik Grzegorzek

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-09-28 18:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 13:53 [PATCH i-g-t 1/4] tests/xe_eudebug: Keep engine for each client Mika Kuoppala
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox