Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Cc: <saurabhg.gupta@intel.com>, <alex.zuo@intel.com>, <raag.jadav@intel.com>
Subject: Re: [PATCH 2/5] drm/xe/heci: Use xe print functions in xe_heci_gsc.c
Date: Fri, 5 Jun 2026 20:41:48 +0200	[thread overview]
Message-ID: <309a9de0-339e-4e01-a336-fca7afb4d798@intel.com> (raw)
In-Reply-To: <20260605160444.3833295-3-jonathan.cavitt@intel.com>



On 6/5/2026 6:04 PM, Jonathan Cavitt wrote:
> Update xe_heci_gsc.c to use the xe error reporting helper functions in
> xe_printk.h instead of directly calling the associated drm print
> functions from drm_print.h
> 
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_heci_gsc.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c
> index 5af8903e10af..d716371fbbe9 100644
> --- a/drivers/gpu/drm/xe/xe_heci_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_heci_gsc.c
> @@ -8,10 +8,9 @@
>  #include <linux/pci.h>
>  #include <linux/sizes.h>
>  
> -#include <drm/drm_print.h>
> -
>  #include "xe_device_types.h"
>  #include "xe_heci_gsc.h"
> +#include "xe_printk.h"
>  #include "regs/xe_gsc_regs.h"

nit: this one is at wrong place
>  #include "xe_platform_types.h"

and xe_printk.h should be here

>  #include "xe_survivability_mode.h"
> @@ -112,13 +111,13 @@ static int heci_gsc_irq_setup(struct xe_device *xe)
>  
>  	heci_gsc->irq = irq_alloc_desc(0);

nit: what about moving to devm_irq_alloc_desc() first?

>  	if (heci_gsc->irq < 0) {
> -		drm_err(&xe->drm, "gsc irq error %d\n", heci_gsc->irq);
> +		xe_err(xe, "gsc irq error %d\n", heci_gsc->irq);

can we print error code in more friendly way using %pe

and I guess we should use "GSC" name, not "gsc", so maybe:

	xe_err(xe, "GSC: irq allocation failed (%pe)\n", ERR_PTR(..

>  		return heci_gsc->irq;
>  	}
>  
>  	ret = heci_gsc_irq_init(heci_gsc->irq);
>  	if (ret < 0)
> -		drm_err(&xe->drm, "gsc irq init failed %d\n", ret);
> +		xe_err(xe, "gsc irq init failed %d\n", ret);

	xe_err(xe, "GSC: irq initialization failed (%pe)\n", ERR_PTR(..

>  
>  	return ret;
>  }
> @@ -151,7 +150,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def *
>  
>  	ret = auxiliary_device_init(aux_dev);
>  	if (ret < 0) {
> -		drm_err(&xe->drm, "gsc aux init failed %d\n", ret);
> +		xe_err(xe, "gsc aux init failed %d\n", ret);
>  		kfree(adev);
>  		return ret;
>  	}
> @@ -159,7 +158,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def *
>  	heci_gsc->adev = adev; /* needed by the notifier */
>  	ret = auxiliary_device_add(aux_dev);
>  	if (ret < 0) {
> -		drm_err(&xe->drm, "gsc aux add failed %d\n", ret);
> +		xe_err(xe, "gsc aux add failed %d\n", ret);
>  		heci_gsc->adev = NULL;
>  
>  		/* adev will be freed with the put_device() and .release sequence */
> @@ -190,7 +189,7 @@ int xe_heci_gsc_init(struct xe_device *xe)
>  	}
>  
>  	if (!def || !def->name) {

missing def looks like our coding error, shouldn't we just use xe_assert()?

missing def->name is also our coding error,
we should have no runtime checks for it (except xe_assert)

> -		drm_warn(&xe->drm, "HECI is not implemented!\n");
> +		xe_warn(xe, "HECI is not implemented!\n");
>  		return 0;
>  	}
>  
> @@ -215,7 +214,7 @@ void xe_heci_gsc_irq_handler(struct xe_device *xe, u32 iir)
>  		return;
>  
>  	if (!xe->info.has_heci_gscfi) {
> -		drm_warn_once(&xe->drm, "GSC irq: not supported");
> +		xe_warn_once(xe, "GSC irq: not supported");

		xe_warn_once(xe, "GSC: unexpected irq %#x\n", iir);

>  		return;
>  	}
>  
> @@ -224,7 +223,7 @@ void xe_heci_gsc_irq_handler(struct xe_device *xe, u32 iir)
>  
>  	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
>  	if (ret)
> -		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
> +		xe_err_ratelimited(xe, "error handling GSC irq: %d\n", ret);

		xe_err_ratelimited(xe, "GSC: irq handling failed (%pe)\n", 

>  }
>  
>  void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)
> @@ -235,7 +234,7 @@ void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)
>  		return;
>  
>  	if (!xe->info.has_heci_cscfi) {
> -		drm_warn_once(&xe->drm, "CSC irq: not supported");
> +		xe_warn_once(xe, "CSC irq: not supported");

		xe_warn_once(xe, "CSC: unexpected irq %#x\n", iir);

>  		return;
>  	}
>  
> @@ -244,5 +243,5 @@ void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)
>  
>  	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
>  	if (ret)
> -		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
> +		xe_err_ratelimited(xe, "error handling GSC irq: %d\n", ret);

GSC or CSC ? function is 'heci_csc'

>  }


  reply	other threads:[~2026-06-05 18:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05 16:04 [PATCH 0/5] drm/{i915, xe}: Refactor generic_handle_irq_safe() error messages Jonathan Cavitt
2026-06-05 16:04 ` [PATCH 1/5] drm/xe/printk: Add xe_warn_once() Jonathan Cavitt
2026-06-05 18:16   ` Michal Wajdeczko
2026-06-05 16:04 ` [PATCH 2/5] drm/xe/heci: Use xe print functions in xe_heci_gsc.c Jonathan Cavitt
2026-06-05 18:41   ` Michal Wajdeczko [this message]
2026-06-05 19:12     ` Cavitt, Jonathan
2026-06-05 16:04 ` [PATCH 3/5] drm/xe/i2c: Use xe print functions in xe_i2c.c Jonathan Cavitt
2026-06-05 16:04 ` [PATCH 4/5] drm/{i915, xe}: Refactor generic_handle_irq_safe() error messages Jonathan Cavitt
2026-06-05 18:48   ` Michal Wajdeczko
2026-06-05 16:04 ` [PATCH 5/5] drm/xe/i2c: Report i2c irq handler issue Jonathan Cavitt
2026-06-05 18:42 ` ✓ i915.CI.BAT: success for drm/{i915, xe}: Refactor generic_handle_irq_safe() error messages (rev2) 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=309a9de0-339e-4e01-a336-fca7afb4d798@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=raag.jadav@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox