[PATCH 2/2] drm/xe: Add fault injection for xe_hw_engine_class_to_str
Michal Wajdeczko
michal.wajdeczko at intel.com
Tue Apr 15 08:56:17 UTC 2025
On 15.04.2025 08:42, Sobin Thomas wrote:
> - Added fault injection for `xe_hw_engine_class_to_str` to enhance coverage.
what kind of coverage this function really provides?
it returns string pointer so it's likely mostly used in the print()
functions which can handle the NULL
and even if it used for something weird when it's really hard to deal
with NULL string, then IMO simpler option would be to update this helper
function to always return non-null string even for the unknown or missed
class like "unk"
btw, it looks that XE_ENGINE_CLASS_MAX was a) just a bad choice to be
included as an enumerator, and b) only this one could return NULL
> - can be tested with igt at inject-fault-probe-function-xe_hw_engine_class_to_str
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
>
> Signed-off-by: Sobin Thomas <sobin.thomas at intel.com>
> ---
> drivers/gpu/drm/xe/xe_hw_engine.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index 93241fd0a4ba..56d95635374a 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> @@ -1011,6 +1011,7 @@ const char *xe_hw_engine_class_to_str(enum xe_engine_class class)
>
> return NULL;
> }
> +ALLOW_ERROR_INJECTION(xe_hw_engine_class_to_str, NULL);
>
> u64 xe_hw_engine_read_timestamp(struct xe_hw_engine *hwe)
> {
More information about the Intel-xe
mailing list