[PATCH i-g-t 4/4] tests/intel/xe_wedged: Test wedged_mode=1 after had toggled mode=2

Rodrigo Vivi rodrigo.vivi at intel.com
Tue Apr 23 22:20:47 UTC 2024


Let's toggle between different modes.

Suggested-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 tests/intel/xe_wedged.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/intel/xe_wedged.c b/tests/intel/xe_wedged.c
index 35fc905e7..b9bd49fad 100644
--- a/tests/intel/xe_wedged.c
+++ b/tests/intel/xe_wedged.c
@@ -216,6 +216,10 @@ simple_hang(int fd)
  * SUBTEST: wedged-at-any-timeout
  * Description: Force Xe device wedged after a simple guc timeout
  */
+/**
+ * SUBTEST: wedged-mode-toggle
+ * Description: Test wedged.mode=1 after testing wedged.mode=2
+ */
 igt_main
 {
 	struct drm_xe_engine_class_instance *hwe;
@@ -257,6 +261,16 @@ igt_main
 			simple_exec(fd, hwe);
 	}
 
+	igt_subtest_f("wedged-mode-toggle") {
+		igt_require(igt_debugfs_exists(fd, "wedged_mode", O_RDWR));
+
+		igt_debugfs_write(fd, "wedged_mode", "2");
+		igt_assert_eq(simple_ioctl(fd), 0);
+		igt_debugfs_write(fd, "wedged_mode", "1");
+		simple_hang(fd);
+		igt_assert_eq(simple_ioctl(fd), 0);
+	}
+
 	igt_fixture {
 		if (igt_debugfs_exists(fd, "fail_gt_reset/probability", O_RDWR)) {
 			igt_debugfs_write(fd, "fail_gt_reset/probability", "0");
-- 
2.44.0



More information about the igt-dev mailing list