[PATCH v4] drm/xe: Add driver load error injection

Lucas De Marchi lucas.demarchi at intel.com
Thu Aug 15 13:43:52 UTC 2024


On Thu, Aug 15, 2024 at 04:34:52PM GMT, Jani Nikula wrote:
>On Wed, 14 Aug 2024, Francois Dugast <francois.dugast at intel.com> wrote:
>> Those new macros inject errors by overriding return codes. They must
>> manually be called, typically by turning this pattern:
>>
>>     err = foo();
>>     if (err)
>>         return err;
>>
>> into:
>>
>>     err = foo();
>>     err = xe_device_inject_driver_probe_error(xe, err);
>>     if (err)
>>         return err;
>>
>> When CONFIG_DRM_XE_DEBUG is not set, this has no effect.
>>
>> When CONFIG_DRM_XE_DEBUG is set, the error code at checkpoint X will
>> be overridden when the module argument inject_driver_load_error is
>> set to value X. By doing so, it is possible to test proper error
>> handling and improve robustness for current and future code. A few
>> injection points are added in this patch but more need to be added.
>> One way to use this error injection at driver probe is:
>>
>>     for i in {1..200}; do echo "Run $i"; modprobe xe inject_driver_probe_error=$i; rmmod xe; done
>>
>> In the future this is expected to be replaced by the infrastructure
>> provided by fault-inject.h
>
>See my comment on a previous version [1].
>
>BR,
>Jani.
>
>[1] https://lore.kernel.org/r/87wmkkzold.fsf@intel.com

yeah, I missed that too. Having the display side covered as well from
the beginning would be good.

Lucas De Marchi


More information about the Intel-xe mailing list