On 6/5/2026 11:05 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. While we're here, we should update the
> error messages to print the error codes in a more friendly way.
>
> v2:
> - Update the error messages to print the error codes in a more friendly
> way (Wajdeczko)
>
> Signed-off-by: Jonathan Cavitt <[email protected]>
> Cc: Michal Wajdeczko <[email protected]>
> ---
> 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..13123990c4e2 100644
> --- a/drivers/gpu/drm/xe/xe_heci_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_heci_gsc.c
> @@ -8,12 +8,11 @@
> #include <linux/pci.h>
> #include <linux/sizes.h>
>
> -#include <drm/drm_print.h>
> -
> #include "xe_device_types.h"
> #include "xe_heci_gsc.h"
> #include "regs/xe_gsc_regs.h"
> #include "xe_platform_types.h"
> +#include "xe_printk.h"
> #include "xe_survivability_mode.h"
>
> #define GSC_BAR_LENGTH 0x00000FFC
> @@ -112,13 +111,13 @@ static int heci_gsc_irq_setup(struct xe_device *xe)
>
> heci_gsc->irq = irq_alloc_desc(0);
> if (heci_gsc->irq < 0) {
> - drm_err(&xe->drm, "gsc irq error %d\n", heci_gsc->irq);
> + xe_err(xe, "GSC: irq allocation failed (%pe)\n",
> ERR_PTR(heci_gsc->irq));
> 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 initialization failed (%pe)\n",
> ERR_PTR(ret));
>
> 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);
"GSC: aux device init failed (%pe)\n"
> 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);
"GSC: aux device add failed (%pe)\n"
> 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) {
> - 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: 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, "GSC: irq handling failed (%pe)\n",
> ERR_PTR(ret));
> }
>
> 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: 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, "CSC: irq handling failed (%pe)\n",
> ERR_PTR(ret));
> }