Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tests/intel/xe_exec_reset: Explicitly declare exec
@ 2024-10-14 22:00 Jonathan Cavitt
  2024-10-14 22:30 ` ✓ Fi.CI.BAT: success for tests/intel/xe_exec_reset: Explicitly declare exec (rev3) Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jonathan Cavitt @ 2024-10-14 22:00 UTC (permalink / raw)
  To: igt-dev
  Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, jani.saarinen,
	ashutosh.dixit

In the gt-reset-stress subtest, we define a drm_xe_exec exec without
declaring any of its variable values.  We then define some of the struct
values separately later in execution.  Instead of doing this, we should
explicitly declare exec to equal a new struct with the assigned values
initialized during construction.  This prevents any values from being
assigned garbage data during execution.

v2: Define assigned variables as a part of declaration, rather than
separately later during exeuction. (Dixit)

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: Jani Saarinen <jani.saarinen@intel.com>
CC: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/intel/xe_exec_reset.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index b5d5f43eab..43ef1e3345 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c
@@ -628,7 +628,10 @@ static void submit_jobs(struct gt_thread_data *t)
 			.engine_instance = 0,
 			.gt_id = 0,
 		};
-		struct drm_xe_exec exec;
+		struct drm_xe_exec exec = {
+			.address = addr,
+			.num_batch_buffer = 1,
+		};
 		int ret;
 
 		/* GuC IDs can get exhausted */
@@ -636,8 +639,6 @@ static void submit_jobs(struct gt_thread_data *t)
 		if (ret)
 			continue;
 
-		exec.address = addr;
-		exec.num_batch_buffer = 1;
 		xe_exec(fd, &exec);
 		xe_exec_queue_destroy(fd, exec.exec_queue_id);
 	}
-- 
2.43.0


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

end of thread, other threads:[~2024-10-16 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 22:00 [PATCH v2] tests/intel/xe_exec_reset: Explicitly declare exec Jonathan Cavitt
2024-10-14 22:30 ` ✓ Fi.CI.BAT: success for tests/intel/xe_exec_reset: Explicitly declare exec (rev3) Patchwork
2024-10-15  0:04 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-10-16  9:14   ` Kamil Konieczny
2024-10-15  7:50 ` [PATCH v2] tests/intel/xe_exec_reset: Explicitly declare exec Nirmoy Das
2024-10-15 16:48 ` ✗ CI.xeFULL: failure for tests/intel/xe_exec_reset: Explicitly declare exec (rev3) Patchwork
2024-10-16  9:17   ` Kamil Konieczny
2024-10-16  8:39 ` ✓ CI.xeBAT: success " Patchwork
2024-10-16 10:26 ` ✗ Fi.CI.BAT: failure for tests/intel/xe_exec_reset: Explicitly declare exec (rev4) Patchwork

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