Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/xe_gt_freq: Use sync reset
@ 2024-09-25 22:09 Vinay Belgaumkar
  2024-09-26  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Vinay Belgaumkar @ 2024-09-25 22:09 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: Vinay Belgaumkar, Badal Nilawar

Some recent WAs reduce the GT freq during driver load/reset. Use sync
reset so that we give enough time for GT frequency to be restored after
reset has completed.

Also, stash/restore frequencies per GT as they can be different.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2676
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2711

Cc: Badal Nilawar <badal.nilawar@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
---
 tests/intel/xe_gt_freq.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index 427e12c55..de4d111ea 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -341,7 +341,8 @@ static void test_reset(int fd, int gt_id, int cycles)
 		igt_assert_f(get_freq(fd, gt_id, "cur") == rpn,
 			     "Failed after %d good cycles\n", i);
 
-		xe_force_gt_reset_async(fd, gt_id);
+		xe_force_gt_reset_sync(fd, gt_id);
+
 		usleep(SLPC_FREQ_LATENCY_US);
 
 		igt_assert_f(get_freq(fd, gt_id, "min") == rpn,
@@ -433,16 +434,23 @@ igt_main
 	int fd;
 	int gt;
 	struct drm_xe_engine_class_instance *hwe;
-	uint32_t stash_min;
-	uint32_t stash_max;
+	uint32_t *stash_min, *stash_max;
+	int num_gts;
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
 
 		igt_require(xe_sysfs_gt_has_node(fd, 0, "freq0"));
+		num_gts = xe_number_gt(fd);
+
 		/* The defaults are the same. Stashing the gt0 is enough */
-		stash_min = get_freq(fd, 0, "min");
-		stash_max = get_freq(fd, 0, "max");
+		stash_min = (uint32_t *) malloc(sizeof(uint32_t) * num_gts);
+		stash_max = (uint32_t *) malloc(sizeof(uint32_t) * num_gts);
+
+		xe_for_each_gt(fd, gt) {
+			stash_min[gt] = get_freq(fd, gt, "min");
+			stash_max[gt] = get_freq(fd, gt, "max");
+		}
 	}
 
 	igt_subtest("throttle_basic_api") {
@@ -517,9 +525,11 @@ igt_main
 
 	igt_fixture {
 		xe_for_each_gt(fd, gt) {
-			set_freq(fd, gt, "min", stash_min);
-			set_freq(fd, gt, "max", stash_max);
+			set_freq(fd, gt, "max", stash_max[gt]);
+			set_freq(fd, gt, "min", stash_min[gt]);
 		}
+		free(stash_min);
+		free(stash_max);
 		drm_close_driver(fd);
 	}
 }
-- 
2.38.1


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

end of thread, other threads:[~2024-10-03 21:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25 22:09 [PATCH i-g-t] tests/xe_gt_freq: Use sync reset Vinay Belgaumkar
2024-09-26  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-09-26 10:21 ` ✗ CI.xeBAT: failure " Patchwork
2024-09-27 18:02   ` Belgaumkar, Vinay
2024-09-26 12:43 ` ✗ Fi.CI.IGT: " Patchwork
2024-09-27 18:04   ` Belgaumkar, Vinay
2024-09-26 14:36 ` [PATCH i-g-t] " Rodrigo Vivi
2024-09-27  2:33 ` ✗ CI.xeFULL: failure for " Patchwork
2024-09-27 18:07   ` Belgaumkar, Vinay
2024-10-03 18:54 ` ✓ CI.xeBAT: success for tests/xe_gt_freq: Use sync reset (rev2) Patchwork
2024-10-03 19:09 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-03 21:15 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-03 21:27 ` [PATCH i-g-t] tests/xe_gt_freq: Use sync reset Dixit, Ashutosh

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