All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_sysfs_scheduler: fix save/restore array indexing
@ 2026-09-01  3:59 nishit.sharma
  2026-09-01 14:33 ` Kamil Konieczny
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nishit.sharma @ 2026-09-01  3:59 UTC (permalink / raw)
  To: igt-dev, kamil.konieczny

From: Nishit Sharma <nishit.sharma@intel.com>

The scheduler property save/restore array was declared as
store[MAX_GTS][3][3] but indexed with the per-GT engine index in the
first (GT) dimension:

This drops the GT dimension completely: on multi-GT systems every GT
overwrites the same slots, so teardown restores each engine's
preempt_timeout/timeslice_duration/job_timeout with values from the
last GT that was saved, tripping the "not restored!" abort. It also
overflows the array whenever a GT exposes more than MAX_GTS engines.

Signed-off-by: Nishit Sharma <nishit.sharma@intel.com>
---
 tests/intel/xe_sysfs_scheduler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_sysfs_scheduler.c b/tests/intel/xe_sysfs_scheduler.c
index 383625064..cbf25762a 100644
--- a/tests/intel/xe_sysfs_scheduler.c
+++ b/tests/intel/xe_sysfs_scheduler.c
@@ -237,7 +237,7 @@ int igt_main()
 				      {"job_timeout_ms", "job_timeout_min", "job_timeout_max"},
 	};
 
-	unsigned int store[MAX_GTS][3][3];
+	unsigned int store[MAX_GTS][XE_MAX_ENGINE_INSTANCE][3][3];
 	int count = sizeof(property) / sizeof(property[0]);
 	int gt_count = 0;
 	int xe = -1;
@@ -271,7 +271,7 @@ int igt_main()
 					const char **pl = property[j];
 
 					for (int k = 0; k < 3; k++) {
-						unsigned int *loc = &store[i][j][k];
+						unsigned int *loc = &store[gt_count][i][j][k];
 
 						igt_require(igt_sysfs_scanf(list[i], pl[k],
 									    "%u", loc) == 1);
@@ -314,7 +314,7 @@ int igt_main()
 
 					for (int k = 2; k >= 0; k--) {
 						unsigned int read = UINT_MAX;
-						unsigned int val = store[i][j][k];
+						unsigned int val = store[gtn][i][j][k];
 
 						igt_sysfs_printf(e, pl[k], "%u", val);
 						igt_sysfs_scanf(e, pl[k], "%u", &read);
-- 
2.43.0


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

end of thread, other threads:[~2026-09-02 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01  3:59 [PATCH] tests/intel/xe_sysfs_scheduler: fix save/restore array indexing nishit.sharma
2026-09-01 14:33 ` Kamil Konieczny
2026-09-01 22:33 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-02 12:53 ` ✓ Xe.CI.FULL: " Patchwork
2026-09-02 13:21 ` ✗ i915.CI.Full: failure " Patchwork

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.