[PATCH i-g-t 4/4] tests/intel/xe_configfs: Reset all custom settings on exit

Lucas De Marchi lucas.demarchi at intel.com
Tue Aug 19 20:40:43 UTC 2025


When exit, make sure there's not device configfs settings, otherwise it
could impact tests running after this.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 tests/intel/xe_configfs.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
index 8b2b8e3c4..a298c212a 100644
--- a/tests/intel/xe_configfs.c
+++ b/tests/intel/xe_configfs.c
@@ -26,7 +26,17 @@ static char bus_addr[NAME_MAX];
 
 static void restore(int sig)
 {
+	int configfs_fd;
+
 	igt_kmod_unbind("xe", bus_addr);
+
+	/* Drop all custom configfs settings from subtests */
+	configfs_fd = igt_configfs_open("xe");
+	if (configfs_fd >= 0)
+		igt_fs_remove_dir(configfs_fd, bus_addr);
+	close(configfs_fd);
+
+	/* Bind again a clean driver with no custom settings */
 	igt_kmod_bind("xe", bus_addr);
 }
 
@@ -164,7 +174,6 @@ igt_main
 		test_engines_allowed(configfs_device_fd);
 
 	igt_fixture {
-		igt_fs_remove_dir(configfs_fd, bus_addr);
 		close(configfs_device_fd);
 		close(configfs_fd);
 	}

-- 
2.50.1



More information about the igt-dev mailing list