[PATCH i-g-t] tests/intel/xe_fault_injection: Injection list clear at exit

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Mar 24 14:36:41 UTC 2025


Hi Marcin,
On 2025-03-21 at 10:53:06 +0100, Marcin Bernatowicz wrote:
> Reintroduce clearing of the injection list as an exit handler to ensure
> fault injections are properly cleaned up.
> 
> Fixes: c0b2d9202f78 ("tests/intel/xe_fault_injection: Use igt_sysfs helpers")
> 
> Cc: Francois Dugast <francois.dugast at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>

Applied, thank you for a fix.

Regards,
Kamil

> ---
>  tests/intel/xe_fault_injection.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
> index 5409d19a6..1bd0f51a3 100644
> --- a/tests/intel/xe_fault_injection.c
> +++ b/tests/intel/xe_fault_injection.c
> @@ -137,6 +137,12 @@ static void setup_injection_fault(void)
>  	close(dir);
>  }
>  
> +static void cleanup_injection_fault(int sig)
> +{
> +	/* If nothing specified (‘’) injection list is cleared */
> +	injection_list_do(INJECTION_LIST_ADD, "");
> +}
> +
>  static void set_retval(const char function_name[], long long retval)
>  {
>  	char path[96];
> @@ -371,6 +377,7 @@ igt_main
>  		fd = drm_open_driver(DRIVER_XE);
>  		igt_device_get_pci_slot_name(fd, pci_slot);
>  		setup_injection_fault();
> +		igt_install_exit_handler(cleanup_injection_fault);
>  	}
>  
>  	for (const struct section *s = vm_create_fail_functions; s->name; s++)
> -- 
> 2.31.1
> 


More information about the igt-dev mailing list