Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Sobin Thomas <sobin.thomas@intel.com>, intel-xe@lists.freedesktop.org
Cc: tejas.upadhyay@intel.com
Subject: Re: [PATCH 2/2] drm/xe: Add fault injection for xe_hw_engine_class_to_str
Date: Tue, 15 Apr 2025 10:56:17 +0200	[thread overview]
Message-ID: <fd748af6-e0f6-434d-ba05-8c2a16631533@intel.com> (raw)
In-Reply-To: <20250415064211.2889970-2-sobin.thomas@intel.com>



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@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@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)
>  {


  reply	other threads:[~2025-04-15  8:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15  6:42 [PATCH 1/2] drm/xe: Add fault injection for kobj_xe_hw_engine_class Sobin Thomas
2025-04-15  6:42 ` [PATCH 2/2] drm/xe: Add fault injection for xe_hw_engine_class_to_str Sobin Thomas
2025-04-15  8:56   ` Michal Wajdeczko [this message]
2025-04-15  7:03 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Add fault injection for kobj_xe_hw_engine_class Patchwork
2025-04-15  7:03 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-15  7:04 ` ✓ CI.KUnit: success " Patchwork
2025-04-15  7:13 ` ✓ CI.Build: " Patchwork
2025-04-15  7:15 ` ✓ CI.Hooks: " Patchwork
2025-04-15  7:16 ` ✓ CI.checksparse: " Patchwork
2025-04-15  8:01 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-15  9:14 ` [PATCH 1/2] " Michal Wajdeczko
2025-04-15 11:25 ` ✗ Xe.CI.Full: failure for series starting with [1/2] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd748af6-e0f6-434d-ba05-8c2a16631533@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sobin.thomas@intel.com \
    --cc=tejas.upadhyay@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox