[PATCH i-g-t 3/4] tests/intel/xe_configfs: Install exit handler once

Riana Tauro riana.tauro at intel.com
Fri Aug 22 06:01:37 UTC 2025



On 8/20/2025 2:10 AM, Lucas De Marchi wrote:
> All the subtests need to restore the device to a working condition.
> Call igt_install_exit_handler() only once, after creating the custom
> settings.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Looks good to me
Reviewed-by: Riana Tauro <riana.tauro at intel.com>

> ---
>   tests/intel/xe_configfs.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
> index 1510f25f0..8b2b8e3c4 100644
> --- a/tests/intel/xe_configfs.c
> +++ b/tests/intel/xe_configfs.c
> @@ -26,7 +26,6 @@ static char bus_addr[NAME_MAX];
>   
>   static void restore(int sig)
>   {
> -	/* Restore after survivability mode */
>   	igt_kmod_unbind("xe", bus_addr);
>   	igt_kmod_bind("xe", bus_addr);
>   }
> @@ -147,26 +146,22 @@ igt_main
>   		configfs_fd = igt_configfs_open("xe");
>   		igt_require(configfs_fd != -1);
>   		configfs_device_fd = create_device_configfs_group(configfs_fd);
> +		igt_install_exit_handler(restore);
>   	}
>   
>   	igt_describe("Validate survivability mode");
>   	igt_subtest("survivability-mode") {
>   		igt_require(IS_BATTLEMAGE(devid));
> -		igt_install_exit_handler(restore);
>   		test_survivability_mode(configfs_device_fd);
>   	}
>   
>   	igt_describe("Validate engines_allowed with invalid options");
> -	igt_subtest("engines-allowed-invalid") {
> -		igt_install_exit_handler(restore);
> +	igt_subtest("engines-allowed-invalid")
>   		test_engines_allowed_invalid(configfs_device_fd);
> -	}
>   
>   	igt_describe("Validate engines_allowed");
> -	igt_subtest("engines-allowed") {
> -		igt_install_exit_handler(restore);
> +	igt_subtest("engines-allowed")
>   		test_engines_allowed(configfs_device_fd);
> -	}
>   
>   	igt_fixture {
>   		igt_fs_remove_dir(configfs_fd, bus_addr);
> 



More information about the igt-dev mailing list