Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Ilia Levi <illevi@habana.ai>, intel-xe@lists.freedesktop.org
Cc: ilia.levi@intel.com, jonathan.cavitt@intel.com,
	koby.elbaz@intel.com, yaron.avizrat@intel.com
Subject: Re: [PATCH v6 1/5] drm/xe: Introduce dedicated config for memirq debug
Date: Wed, 18 Sep 2024 12:44:28 +0200	[thread overview]
Message-ID: <122c8732-04b0-4e8b-b645-90faf588dd44@intel.com> (raw)
In-Reply-To: <20240918053942.1331811-2-illevi@habana.ai>



On 18.09.2024 07:39, Ilia Levi wrote:
> From: Ilia Levi <ilia.levi@intel.com>
> 
> Separate config for debugging memory based interrupts (memirq)
> infrastructure.
> 
> Signed-off-by: Ilia Levi <ilia.levi@intel.com>

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

> ---

in the future please try to include patch changelog like:

v2: also convert logging macros (Michal)

>  drivers/gpu/drm/xe/Kconfig.debug | 12 ++++++++++++
>  drivers/gpu/drm/xe/xe_memirq.c   | 29 +++++++++++++++++++----------
>  2 files changed, 31 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug
> index bc177368af6c..2de0de41b8dd 100644
> --- a/drivers/gpu/drm/xe/Kconfig.debug
> +++ b/drivers/gpu/drm/xe/Kconfig.debug
> @@ -40,9 +40,21 @@ config DRM_XE_DEBUG_VM
>  
>  	  If in doubt, say "N".
>  
> +config DRM_XE_DEBUG_MEMIRQ
> +	bool "Enable extra memirq debugging"
> +	default n
> +	help
> +	  Choose this option to enable additional debugging info for
> +	  memory based interrupts.
> +
> +	  Recommended for driver developers only.
> +
> +	  If in doubt, say "N".
> +
>  config DRM_XE_DEBUG_SRIOV
>  	bool "Enable extra SR-IOV debugging"
>  	default n
> +	select DRM_XE_DEBUG_MEMIRQ
>  	help
>  	  Enable extra SR-IOV debugging info.
>  
> diff --git a/drivers/gpu/drm/xe/xe_memirq.c b/drivers/gpu/drm/xe/xe_memirq.c
> index 95b6e9d7b7db..ecb4870c3356 100644
> --- a/drivers/gpu/drm/xe/xe_memirq.c
> +++ b/drivers/gpu/drm/xe/xe_memirq.c
> @@ -20,10 +20,21 @@
>  #include "xe_map.h"
>  #include "xe_memirq.h"
>  #include "xe_sriov.h"
> -#include "xe_sriov_printk.h"
>  
>  #define memirq_assert(m, condition)	xe_tile_assert(memirq_to_tile(m), condition)
> -#define memirq_debug(m, msg...)		xe_sriov_dbg_verbose(memirq_to_xe(m), "MEMIRQ: " msg)
> +#define memirq_printk(m, _level, _fmt, ...)			\
> +	drm_##_level(&memirq_to_xe(m)->drm, "MEMIRQ%u: " _fmt,	\
> +		     memirq_to_tile(m)->id, ##__VA_ARGS__)
> +
> +#ifdef CONFIG_DRM_XE_DEBUG_MEMIRQ
> +#define memirq_debug(m, _fmt, ...)	memirq_printk(m, dbg, _fmt, ##__VA_ARGS__)
> +#else
> +#define memirq_debug(...)
> +#endif
> +
> +#define memirq_err(m, _fmt, ...)	memirq_printk(m, err, _fmt, ##__VA_ARGS__)
> +#define memirq_err_ratelimited(m, _fmt, ...)	\
> +	memirq_printk(m, err_ratelimited, _fmt, ##__VA_ARGS__)
>  
>  static struct xe_tile *memirq_to_tile(struct xe_memirq *memirq)
>  {
> @@ -157,8 +168,7 @@ static int memirq_alloc_pages(struct xe_memirq *memirq)
>  	return drmm_add_action_or_reset(&xe->drm, __release_xe_bo, memirq->bo);
>  
>  out:
> -	xe_sriov_err(memirq_to_xe(memirq),
> -		     "Failed to allocate memirq page (%pe)\n", ERR_PTR(err));
> +	memirq_err(memirq, "Failed to allocate memirq page (%pe)\n", ERR_PTR(err));
>  	return err;
>  }
>  
> @@ -299,9 +309,8 @@ int xe_memirq_init_guc(struct xe_memirq *memirq, struct xe_guc *guc)
>  	return 0;
>  
>  failed:
> -	xe_sriov_err(memirq_to_xe(memirq),
> -		     "Failed to setup report pages in %s (%pe)\n",
> -		     guc_name(guc), ERR_PTR(err));
> +	memirq_err(memirq, "Failed to setup report pages in %s (%pe)\n",
> +		   guc_name(guc), ERR_PTR(err));
>  	return err;
>  }
>  
> @@ -349,9 +358,9 @@ static bool memirq_received(struct xe_memirq *memirq, struct iosys_map *vector,
>  	value = iosys_map_rd(vector, offset, u8);
>  	if (value) {
>  		if (value != 0xff)
> -			xe_sriov_err_ratelimited(memirq_to_xe(memirq),
> -						 "Unexpected memirq value %#x from %s at %u\n",
> -						 value, name, offset);
> +			memirq_err_ratelimited(memirq,
> +					       "Unexpected memirq value %#x from %s at %u\n",
> +					       value, name, offset);
>  		iosys_map_wr(vector, offset, u8, 0x00);
>  	}
>  

  reply	other threads:[~2024-09-18 10:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  5:39 [PATCH v6 0/5] memirq infra changes Ilia Levi
2024-09-18  5:39 ` [PATCH v6 1/5] drm/xe: Introduce dedicated config for memirq debug Ilia Levi
2024-09-18 10:44   ` Michal Wajdeczko [this message]
2024-09-18  5:39 ` [PATCH v6 2/5] drm/xe: Introduce xe_device_uses_memirq() Ilia Levi
2024-09-18  5:39 ` [PATCH v6 3/5] drm/xe: move memirq out of VF Ilia Levi
2024-09-18  5:39 ` [PATCH v6 4/5] drm/xe: memirq infra changes for MSI-X Ilia Levi
2024-09-18  5:39 ` [PATCH v6 5/5] drm/xe: memirq handler changes Ilia Levi
2024-09-18  6:07 ` ✓ CI.Patch_applied: success for memirq infra changes (rev7) Patchwork
2024-09-18  6:07 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-18  6:09 ` ✓ CI.KUnit: success " Patchwork
2024-09-18  6:26 ` ✓ CI.Build: " Patchwork
2024-09-18  6:30 ` ✓ CI.Hooks: " Patchwork
2024-09-18  6:32 ` ✓ CI.checksparse: " Patchwork
2024-09-18  6:57 ` ✗ CI.BAT: failure " Patchwork
2024-09-18  8:25 ` ✗ CI.FULL: " Patchwork
2024-09-18 13:38 ` ✓ CI.Patch_applied: success for memirq infra changes (rev8) Patchwork
2024-09-18 13:38 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-18 13:39 ` ✓ CI.KUnit: success " Patchwork
2024-09-18 13:51 ` ✓ CI.Build: " Patchwork
2024-09-18 13:53 ` ✓ CI.Hooks: " Patchwork
2024-09-18 13:56 ` ✓ CI.checksparse: " Patchwork
2024-09-18 14:14 ` ✓ CI.BAT: " Patchwork
2024-09-18 20:06 ` ✗ CI.FULL: failure " Patchwork
2024-09-19  8:30   ` Michal Wajdeczko

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=122c8732-04b0-4e8b-b645-90faf588dd44@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=ilia.levi@intel.com \
    --cc=illevi@habana.ai \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=koby.elbaz@intel.com \
    --cc=yaron.avizrat@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