[PATCH v2] drm/xe/guc: Add more GuC load error status codes
Summers, Stuart
stuart.summers at intel.com
Mon Jul 28 18:07:42 UTC 2025
On Fri, 2025-07-25 at 19:43 -0700, John.C.Harrison at Intel.com wrote:
> From: John Harrison <John.C.Harrison at Intel.com>
>
> The GuC load process will abort if certain status codes (which are
> indicative of a fatal error) are reported. Otherwise, it keeps
> waiting
> until the 'success' code is returned. New error codes have been added
> in recent GuC releases, so add support for aborting on those as well.
>
> v2: Shuffle HWCONFIG_START to the front of the switch to keep the
> ordering as per the enum define for clarity (review feedback by
> Jonathan). Also add a description for the basic 'invalid init data'
> code which was missing.
>
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
Great to include these more specific error codes I agree. Verified
these line up to what the GuC is sending:
Reviewed-by: Stuart Summers <stuart.summers at intel.com>
> ---
> drivers/gpu/drm/xe/abi/guc_errors_abi.h | 3 +++
> drivers/gpu/drm/xe/xe_guc.c | 19 +++++++++++++++++--
> 2 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/abi/guc_errors_abi.h
> b/drivers/gpu/drm/xe/abi/guc_errors_abi.h
> index ecf748fd87df..ad76b4baf42e 100644
> --- a/drivers/gpu/drm/xe/abi/guc_errors_abi.h
> +++ b/drivers/gpu/drm/xe/abi/guc_errors_abi.h
> @@ -63,6 +63,7 @@ enum xe_guc_load_status {
> XE_GUC_LOAD_STATUS_HWCONFIG_START = 0x05,
> XE_GUC_LOAD_STATUS_HWCONFIG_DONE = 0x06,
> XE_GUC_LOAD_STATUS_HWCONFIG_ERROR = 0x07,
> + XE_GUC_LOAD_STATUS_BOOTROM_VERSION_MISMATCH = 0x08,
> XE_GUC_LOAD_STATUS_GDT_DONE = 0x10,
> XE_GUC_LOAD_STATUS_IDT_DONE = 0x20,
> XE_GUC_LOAD_STATUS_LAPIC_DONE = 0x30,
> @@ -75,6 +76,8 @@ enum xe_guc_load_status {
> XE_GUC_LOAD_STATUS_INVALID_INIT_DATA_RANGE_START,
> XE_GUC_LOAD_STATUS_MPU_DATA_INVALID = 0x73,
> XE_GUC_LOAD_STATUS_INIT_MMIO_SAVE_RESTORE_INVALID = 0x74,
> + XE_GUC_LOAD_STATUS_KLV_WORKAROUND_INIT_ERROR = 0x75,
> + XE_GUC_LOAD_STATUS_INVALID_FTR_FLAG = 0x76,
> XE_GUC_LOAD_STATUS_INVALID_INIT_DATA_RANGE_END,
>
> XE_GUC_LOAD_STATUS_READY = 0xF0,
> diff --git a/drivers/gpu/drm/xe/xe_guc.c
> b/drivers/gpu/drm/xe/xe_guc.c
> index 1ca7f4f27e26..c49feb8ea0c3 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -992,11 +992,14 @@ static int guc_load_done(u32 status)
> case XE_GUC_LOAD_STATUS_GUC_PREPROD_BUILD_MISMATCH:
> case XE_GUC_LOAD_STATUS_ERROR_DEVID_INVALID_GUCTYPE:
> case XE_GUC_LOAD_STATUS_HWCONFIG_ERROR:
> + case XE_GUC_LOAD_STATUS_BOOTROM_VERSION_MISMATCH:
> case XE_GUC_LOAD_STATUS_DPC_ERROR:
> case XE_GUC_LOAD_STATUS_EXCEPTION:
> 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;
> }
>
> @@ -1137,17 +1140,29 @@ static void guc_wait_ucode(struct xe_guc
> *guc)
> }
>
> switch (ukernel) {
> + case XE_GUC_LOAD_STATUS_HWCONFIG_START:
> + xe_gt_err(gt, "still extracting hwconfig
> table.\n");
> + break;
> +
> case XE_GUC_LOAD_STATUS_EXCEPTION:
> xe_gt_err(gt, "firmware exception. EIP:
> %#x\n",
> xe_mmio_read32(mmio,
> SOFT_SCRATCH(13)));
> break;
>
> + case XE_GUC_LOAD_STATUS_INIT_DATA_INVALID:
> + xe_gt_err(gt, "illegal init/ADS data\n");
> + break;
> +
> case
> XE_GUC_LOAD_STATUS_INIT_MMIO_SAVE_RESTORE_INVALID:
> xe_gt_err(gt, "illegal register in
> save/restore workaround list\n");
> break;
>
> - case XE_GUC_LOAD_STATUS_HWCONFIG_START:
> - xe_gt_err(gt, "still extracting hwconfig
> table.\n");
> + case XE_GUC_LOAD_STATUS_KLV_WORKAROUND_INIT_ERROR:
> + xe_gt_err(gt, "illegal workaround KLV
> data\n");
> + break;
> +
> + case XE_GUC_LOAD_STATUS_INVALID_FTR_FLAG:
> + xe_gt_err(gt, "illegal feature flag
> specified\n");
> break;
> }
>
More information about the Intel-xe
mailing list