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: drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class
Date: Mon, 7 Apr 2025 12:22:12 +0200	[thread overview]
Message-ID: <3c2ef067-9290-4b2e-90a0-1ecccfb36ecb@intel.com> (raw)
In-Reply-To: <20250405071703.2255259-1-sobin.thomas@intel.com>

Hi,

Please use shorter title

You may drop "xe_hw_engine_class:" tag from the prefix
Just "drm/xe:" or "drm/xe/sysfs:" should be sufficient

On 05.04.2025 09:17, Sobin Thomas wrote:
> - Added fault injection for `kobj_xe_hw_engine_class` to enhance coverage.
> - Improved error handling by checking for `IS_ERR_OR_NULL` on `keclass` and
>   propagating the error using `PTR_ERR`.

Describe your changes according to [1] and (in case it turns out both
changes are correct) consider split them into two patches since they are
logically separate [2]

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

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

> 
> Can be tested using inject-fault-probe-function-kobj_xe_hw_engine_class

Please mention that this is about IGT test (or use igt@... notation)

> 
> Signed-off-by: Sobin Thomas <sobin.thomas@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> 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..0cafe1175389 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);
>  
>  static void hw_engine_class_defaults_fini(void *arg)
>  {
> @@ -662,8 +663,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
>  		}
>  
>  		keclass = kobj_xe_hw_engine_class(xe, kobj, name);
> -		if (!keclass) {
> -			err = -EINVAL;
> +		if (IS_ERR_OR_NULL(keclass)) {

why?

kobj_xe_hw_engine_class() seems to be always returning NULL on any error
condition, and for error injection cases you also declare it as
EI_ETYPE_NULL, not as EI_ETYPE_ERRNO_NULL like this condition may
suggest, so it should be never an ERR_PTR

> +			err = PTR_ERR(keclass);

and now when kobj_xe_hw_engine_class() actually fails and returns NULL
then "err" will be 0 instead of any proper error code

>  			goto err_object;
>  		}
>  


  parent reply	other threads:[~2025-04-07 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-05  7:17 drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class Sobin Thomas
2025-04-05  8:26 ` ✓ CI.Patch_applied: success for " Patchwork
2025-04-05  8:27 ` ✓ CI.checkpatch: " Patchwork
2025-04-05  8:28 ` ✓ CI.KUnit: " Patchwork
2025-04-05  8:44 ` ✓ CI.Build: " Patchwork
2025-04-05  8:47 ` ✓ CI.Hooks: " Patchwork
2025-04-05  8:48 ` ✓ CI.checksparse: " Patchwork
2025-04-07  3:29 ` Upadhyay, Tejas
2025-04-07 10:22 ` Michal Wajdeczko [this message]
2025-04-07 13:15 ` ✓ CI.Patch_applied: success for drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class (rev2) Patchwork
2025-04-07 13:15 ` ✓ CI.checkpatch: " Patchwork
2025-04-07 13:16 ` ✓ CI.KUnit: " Patchwork
2025-04-07 13:20 ` ✗ CI.Build: failure " Patchwork
2025-04-07 20:56 ` ✗ Xe.CI.Full: failure for drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class 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=3c2ef067-9290-4b2e-90a0-1ecccfb36ecb@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