[PATCH i-g-t v2 4/4] tests/intel/xe_configfs: Reset all custom settings on exit
Lucas De Marchi
lucas.demarchi at intel.com
Mon Aug 25 15:59:46 UTC 2025
When exit, make sure there's not device configfs settings, otherwise it
could impact tests running after this.
Reviewed-by: Riana Tauro <riana.tauro at intel.com>
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 4f8b873d2..086f99ba5 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