From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: <saurabhg.gupta@intel.com>, <alex.zuo@intel.com>,
<john.c.harrison@intel.com>, <matthew.brost@intel.com>
Subject: Re: [PATCH v4 1/3] drm/xe: Add error_injectable define
Date: Wed, 27 Aug 2025 21:28:34 +0200 [thread overview]
Message-ID: <dbdfba5f-1026-4ecb-86d7-f33e84eb39d9@intel.com> (raw)
In-Reply-To: <20250827182612.106364-6-jonathan.cavitt@intel.com>
On 8/27/2025 8:26 PM, Jonathan Cavitt wrote:
> Add a declaration for the function attribute "error_injectable", which
> appends noinline to functions tagged with ALLOW_ERROR_INJECTION only if
> CONFIG_FUNCTION_ERROR_INJECTION is enabled.
this really doesn't answer the question "why"
> This function attribute was
> added to drivers/gpu/drm/xe/xe_macros.h,
this can be clearly seen in diff
> and has been applied to
> all Xe functions with ALLOW_ERROR_INJECTION enabled.
>
> v2:
> - Move error_injectable from error-injection.h to xe_macros.h
> (Wajdeczko)
it would be better to just say (Michal)
> - Reformat function attribute application to minimize diff size (Brost)
>
> Suggested-by: Matthew Brost <matthew.brost@intel.com>
> Suggested-by: John Harrison <john.c.harrison@intel.com>
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_device.c | 3 +++
> drivers/gpu/drm/xe/xe_exec_queue.c | 2 ++
> drivers/gpu/drm/xe/xe_ggtt.c | 1 +
> drivers/gpu/drm/xe/xe_guc.c | 1 +
> drivers/gpu/drm/xe/xe_guc_ads.c | 1 +
> drivers/gpu/drm/xe/xe_guc_ct.c | 20 +++++--------------
> drivers/gpu/drm/xe/xe_guc_log.c | 1 +
> drivers/gpu/drm/xe/xe_guc_relay.c | 1 +
> drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 2 ++
> drivers/gpu/drm/xe/xe_hw_engine_group.c | 1 +
> drivers/gpu/drm/xe/xe_macros.h | 6 ++++++
> drivers/gpu/drm/xe/xe_mmio.c | 1 +
> drivers/gpu/drm/xe/xe_oa.c | 1 +
> drivers/gpu/drm/xe/xe_pcode.c | 2 ++
> drivers/gpu/drm/xe/xe_pm.c | 1 +
> drivers/gpu/drm/xe/xe_pt.c | 3 +++
> drivers/gpu/drm/xe/xe_sriov.c | 2 ++
> drivers/gpu/drm/xe/xe_sync.c | 1 +
> drivers/gpu/drm/xe/xe_tile.c | 1 +
> drivers/gpu/drm/xe/xe_tuning.c | 2 ++
> drivers/gpu/drm/xe/xe_uc_fw.c | 1 +
> drivers/gpu/drm/xe/xe_vm.c | 5 +++++
> drivers/gpu/drm/xe/xe_wa.c | 2 ++
> drivers/gpu/drm/xe/xe_wopcm.c | 1 +
> 24 files changed, 47 insertions(+), 15 deletions(-)
>
...
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index 3f4e6a46ff16..a7b7045fc732 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -213,6 +213,7 @@ static void primelockdep(struct xe_guc_ct *ct)
> fs_reclaim_release(GFP_KERNEL);
> }
>
> +error_injectable
> int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
> {
> struct xe_device *xe = ct_to_xe(ct);
> @@ -252,6 +253,7 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
> }
> ALLOW_ERROR_INJECTION(xe_guc_ct_init_noalloc, ERRNO); /* See xe_pci_probe() */
>
> +error_injectable
> int xe_guc_ct_init(struct xe_guc_ct *ct)
> {
> struct xe_device *xe = ct_to_xe(ct);
> @@ -1149,6 +1151,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
> * DATA0 from `HXG Response`_ if &response_buffer was NULL, or
> * a negative error code on failure.
> */
> +error_injectable
> int xe_guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
> u32 *response_buffer)
> {
> @@ -2069,22 +2072,9 @@ void xe_guc_ct_print(struct xe_guc_ct *ct, struct drm_printer *p, bool want_ctb)
>
> #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
>
> -#ifdef CONFIG_FUNCTION_ERROR_INJECTION
> -/*
> - * This is a helper function which assists the driver in identifying if a fault
> - * injection test is currently active, allowing it to reduce unnecessary debug
> - * output. Typically, the function returns zero, but the fault injection
> - * framework can alter this to return an error. Since faults are injected
you can use some parts of below explanation in your commit msg
> - * through this function, it's important to ensure the compiler doesn't optimize
> - * it into an inline function. To avoid such optimization, the 'noinline'
> - * attribute is applied.
....
> diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
> index 8a77c2423555..0d09a213eaba 100644
> --- a/drivers/gpu/drm/xe/xe_macros.h
> +++ b/drivers/gpu/drm/xe/xe_macros.h
> @@ -19,4 +19,10 @@
> cond__; \
> })
>
and it wouldn't hurt if we also put some description here with
how/when to use below macro
> +#ifdef CONFIG_FUNCTION_ERROR_INJECTION
> +#define error_injectable noinline
> +#else
> +#define error_injectable
> +#endif
> +
> #endif
next prev parent reply other threads:[~2025-08-27 19:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 18:26 [PATCH v4 0/3] drm/xe/xe_vm: Add error injection support to lock and prep Jonathan Cavitt
2025-08-27 18:26 ` [PATCH v4 1/3] drm/xe: Add error_injectable define Jonathan Cavitt
2025-08-27 19:28 ` Michal Wajdeczko [this message]
2025-08-27 18:26 ` [PATCH v4 2/3] Revert "drm/xe: Add VM bind IOCTL error injection" Jonathan Cavitt
2025-08-27 18:26 ` [PATCH v4 3/3] drm/xe/xe_vm: Add error injection support to lock and prep Jonathan Cavitt
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=dbdfba5f-1026-4ecb-86d7-f33e84eb39d9@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=alex.zuo@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=john.c.harrison@intel.com \
--cc=jonathan.cavitt@intel.com \
--cc=matthew.brost@intel.com \
--cc=saurabhg.gupta@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.