[PATCH i-g-t 4/4] tests/intel/xe_configfs: Reset all custom settings on exit
Riana Tauro
riana.tauro at intel.com
Mon Aug 25 11:18:26 UTC 2025
On 8/20/2025 2:10 AM, Lucas De Marchi wrote:
> 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>
Reviewed-by: Riana Tauro <riana.tauro 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);
> }
>
More information about the igt-dev
mailing list