From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>,
Mallesh Koujalagi <mallesh.koujalagi@intel.com>,
Alan Previn Teres Alexis <alan.previn.teres.alexis@intel.com>,
Julia Filipchuk <julia.filipchuk@intel.com>
Subject: Re: [PATCH 2/3] drm/xe/guc: Report major GuC failures using SIGID
Date: Thu, 27 Aug 2026 13:47:20 +0200 [thread overview]
Message-ID: <87cb2591-f4da-4d05-b650-39b0d62ff1f3@intel.com> (raw)
In-Reply-To: <20260827002801.837731-2-daniele.ceraolospurio@intel.com>
On 8/27/2026 2:28 AM, Daniele Ceraolo Spurio wrote:
> Convert errors during critical GuC flows (init, load, reset, suspend)
> to use the xe_log_err() helper.
> For the GuC load failure scenario, the possible failure modes have been
> bucketed into 3 different possible error codes to distinguish a bad
> binary from a driver error or unexpected HW behavior.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
> Cc: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
> Cc: Alan Previn Teres Alexis <alan.previn.teres.alexis@intel.com>
> Cc: Julia Filipchuk <julia.filipchuk@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc.c | 26 +++++++++++++++-----------
> 1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index c7f8bbd4cb92..484cb47fbc81 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -777,7 +777,7 @@ int xe_guc_init_noalloc(struct xe_guc *guc)
> return 0;
>
> out:
> - xe_gt_err(gt, "GuC init failed with %pe\n", ERR_PTR(ret));
> + xe_log_err(gt, GUC, ret, "GuC init failed\n");
> return ret;
> }
>
> @@ -845,7 +845,7 @@ int xe_guc_init(struct xe_guc *guc)
> return 0;
>
> out:
> - xe_gt_err(gt, "GuC init failed with %pe\n", ERR_PTR(ret));
> + xe_log_err(gt, GUC, ret, "GuC init failed\n");
> return ret;
> }
>
> @@ -998,14 +998,15 @@ int xe_guc_reset(struct xe_guc *guc)
>
> ret = xe_mmio_wait32(mmio, GDRST, GRDOM_GUC, 0, 5000, &gdrst, false);
> if (ret) {
> - xe_gt_err(gt, "GuC reset timed out, GDRST=%#x\n", gdrst);
> + xe_log_err(gt, GUC, -EIO, "GuC reset timed out, GDRST=%#x\n", gdrst);
IIUC we want to pass error codes as-is (if available), not to
replace them with some ad-hoc different errno
> goto err_out;
> }
>
> guc_status = xe_mmio_read32(mmio, GUC_STATUS);
> if (!(guc_status & GS_MIA_IN_RESET)) {
> - xe_gt_err(gt, "GuC status: %#x, MIA core expected to be in reset\n",
> - guc_status);
> + xe_log_err(gt, GUC, -EIO,
> + "GuC status: %#x, MIA core expected to be in reset\n",
> + guc_status);
nit: we could try to pass 'ret'
> ret = -EIO;
> goto err_out;
> }
> @@ -1163,14 +1164,16 @@ static int guc_load_done(struct xe_gt *gt, u32 *status, u32 *tries)
better to move changes to load_done() into a separate patch
also update load_done() function comment which still mention only -1/1
and maybe to follow general api convention we should use 0
to indicate success and -EBUSY for in-progress ?
and then
ret = poll_timeout_us(load_result = guc_load_done(gt, &status, &tries),
load_result != -EBUSY, ...
> case XE_GUC_LOAD_STATUS_ERROR_DEVID_INVALID_GUCTYPE:
> case XE_GUC_LOAD_STATUS_HWCONFIG_ERROR:
> case XE_GUC_LOAD_STATUS_BOOTROM_VERSION_MISMATCH:
> + return -ENOEXEC;
> case XE_GUC_LOAD_STATUS_DPC_ERROR:
> case XE_GUC_LOAD_STATUS_EXCEPTION:
> + return -EIO;
> case XE_GUC_LOAD_STATUS_INIT_DATA_INVALID:
> case XE_GUC_LOAD_STATUS_MPU_DATA_INVALID:
> case XE_GUC_LOAD_STATUS_INIT_MMIO_SAVE_RESTORE_INVALID:
> case XE_GUC_LOAD_STATUS_KLV_WORKAROUND_INIT_ERROR:
> case XE_GUC_LOAD_STATUS_INVALID_FTR_FLAG:
> - return -1;
> + return -EINVAL;
> }
>
> switch (bootrom) {
> @@ -1184,7 +1187,7 @@ static int guc_load_done(struct xe_gt *gt, u32 *status, u32 *tries)
> case XE_BOOTROM_STATUS_MPUMAP_INCORRECT:
> case XE_BOOTROM_STATUS_EXCEPTION:
> case XE_BOOTROM_STATUS_PROD_KEY_CHECK_FAILURE:
> - return -1;
> + return -ENOEXEC;
> }
>
> if (++*tries >= 100) {
> @@ -1222,9 +1225,10 @@ static int guc_wait_ucode(struct xe_guc *guc)
> cur_freq = xe_guc_pc_get_cur_freq_fw(guc_pc);
>
> if (ret || load_result <= 0) {
> - xe_gt_err(gt, "load failed: status = 0x%08X, time = %lldms, freq = %dMHz (req %dMHz)\n",
> - status, delta_ms, xe_guc_pc_get_act_freq(guc_pc),
> - xe_guc_pc_get_cur_freq_fw(guc_pc));
> + xe_log_err(gt, GUC, ret ?: load_result,
> + "load failed: status = 0x%08X, time = %lldms, freq = %dMHz (req %dMHz)\n",
> + status, delta_ms, xe_guc_pc_get_act_freq(guc_pc),
> + xe_guc_pc_get_cur_freq_fw(guc_pc));
we can use 'act_freq' and 'cur_freq'
> print_load_status_err(gt, status);
>
> return -EPROTO;
hmm, -EPROTO was likely already incorrect, but now we should
return ret ?: load_result;
> @@ -1461,7 +1465,7 @@ int xe_guc_suspend(struct xe_guc *guc)
>
> ret = xe_guc_softreset(guc);
> if (ret) {
> - xe_gt_err(gt, "GuC suspend failed: %pe\n", ERR_PTR(ret));
> + xe_log_err(gt, GUC, ret, "GuC suspend failed\n");
> return ret;
> }
>
next prev parent reply other threads:[~2026-08-27 11:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 0:27 [PATCH 1/3] drm/xe/uc: Report DMA failure using SIGID Daniele Ceraolo Spurio
2026-08-27 0:28 ` [PATCH 2/3] drm/xe/guc: Report major GuC failures " Daniele Ceraolo Spurio
2026-08-27 11:47 ` Michal Wajdeczko [this message]
2026-08-27 0:28 ` [PATCH 3/3] drm/xe/guc: Report errors that cause a CT shutdown " Daniele Ceraolo Spurio
2026-08-27 14:34 ` Michal Wajdeczko
2026-08-27 21:33 ` Daniele Ceraolo Spurio
2026-08-27 22:41 ` Michal Wajdeczko
2026-08-27 0:36 ` ✓ CI.KUnit: success for series starting with [1/3] drm/xe/uc: Report DMA failure " Patchwork
2026-08-27 1:35 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-27 2:39 ` ✓ Xe.CI.FULL: " Patchwork
2026-08-27 11:21 ` [PATCH 1/3] " 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=87cb2591-f4da-4d05-b650-39b0d62ff1f3@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=alan.previn.teres.alexis@intel.com \
--cc=aravind.iddamsetty@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=julia.filipchuk@intel.com \
--cc=mallesh.koujalagi@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