Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_drm_fdinfo: Do not destroy NULL xe_cork
@ 2024-12-18 16:08 Jonathan Cavitt
  2024-12-18 23:29 ` ✗ i915.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jonathan Cavitt @ 2024-12-18 16:08 UTC (permalink / raw)
  To: igt-dev
  Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, zbigniew.kempczynski,
	pravalika.gurram

Several xe_cork functionalities were recently unified into the xe_spin
library.  During this process, it was asserted that we always pass a
valid cork to the various xe_cork helper functions (namely,
xe_cork_sync_start, xe_cork_sync_end, and xe_cork_destroy).

While this assertion should normally hold, in xe_drm_fdinfo
specifically, some subtests declare the existence of an xe_cork but
bypass its initialization through xe_cork_create because the cork is
otherwise unused.  However, the cork itself is unconditionally destroyed
at the end of the tests, as prior to the unification under xe_spin,
passing a NULL pointer to the destroy function (previously
spin_ctx_destroy) would simply exit the function early.  Unfortunately,
passing a NULL pointer to the destroy function now (xe_cork_destory)
hits the new assertion, resulting in an error.

Do not run xe_cork_destroy on a NULL pointer if a NULL pointer is
expected in the subtest.

Fixes: 2feb1d6718a ("lib/xe/xe_spin: move the spinner related functions to lib")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3869
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: Pravalika Gurram <pravalika.gurram@intel.com>
CC: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/intel/xe_drm_fdinfo.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_drm_fdinfo.c b/tests/intel/xe_drm_fdinfo.c
index 66a181d5ba..e83c55c646 100644
--- a/tests/intel/xe_drm_fdinfo.c
+++ b/tests/intel/xe_drm_fdinfo.c
@@ -447,7 +447,9 @@ utilization_single(int fd, struct drm_xe_engine_class_instance *hwe, unsigned in
 		close(new_fd);
 	}
 
-	xe_cork_destroy(fd, ctx);
+	if (flags & TEST_BUSY)
+		xe_cork_destroy(fd, ctx);
+
 	xe_vm_destroy(fd, vm);
 }
 
@@ -663,7 +665,8 @@ utilization_multi(int fd, int gt, int class, unsigned int flags)
 		close(fd_spill);
 	}
 
-	xe_cork_destroy(fd, ctx);
+	if (flags & TEST_BUSY)
+		xe_cork_destroy(fd, ctx);
 
 	xe_vm_destroy(fd, vm);
 }
-- 
2.43.0


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

end of thread, other threads:[~2024-12-20 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 16:08 [PATCH] tests/intel/xe_drm_fdinfo: Do not destroy NULL xe_cork Jonathan Cavitt
2024-12-18 23:29 ` ✗ i915.CI.BAT: failure for " Patchwork
2024-12-20 16:22   ` Kamil Konieczny
2024-12-19  1:30 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-19  4:21 ` [PATCH] " Zbigniew Kempczyński
2024-12-19 19:16 ` ✗ Xe.CI.Full: failure for " Patchwork
2024-12-20 16:21   ` Kamil Konieczny

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