[PATCH 1/2] drm/xe: Add fault injection for kobj_xe_hw_engine_class

Michal Wajdeczko michal.wajdeczko at intel.com
Tue Apr 15 09:14:33 UTC 2025



On 15.04.2025 08:42, Sobin Thomas wrote:
> - Add NULL ptr injection for kobj_xe_hw_engine_class
> - Can be tested with igt at inject-fault-probe-function-kobj_xe_hw_engine_class 

don't use bullets and "describe your changes in imperative mood"
see [1]

[1]
https://docs.kernel.org/process/submitting-patches.html#describe-your-changes

> 
> v2: Modified the Fault injection with NULL.
> 
> v1: Initial checkin for Fault Handler.
> 
> Signed-off-by: Sobin Thomas <sobin.thomas at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> index 640950172088..f9616ddf4376 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> @@ -571,6 +571,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
>  
>  	return keclass;
>  }
> +ALLOW_ERROR_INJECTION(kobj_xe_hw_engine_class, NULL);

while this looks fine, I'm wondering whether the better option would be
to start testing all slab failures and thus cover much more fail points
in the driver, as after all injecting NULL here is the same thing as
failing kzalloc used by this function, see also [2]

+ @Lucas

[2]
https://docs.kernel.org/fault-injection/fault-injection.html#application-examples

>  
>  static void hw_engine_class_defaults_fini(void *arg)
>  {



More information about the Intel-xe mailing list