Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Harrison <john.c.harrison@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Vinay Belgaumkar" <vinay.belgaumkar@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Maarten Lankhorst" <dev@lankhorst.se>
Subject: Re: [PATCH v3 4/5] drm/xe/guc: Extract function to print load error
Date: Tue, 16 Sep 2025 13:06:07 -0700	[thread overview]
Message-ID: <3f9169e9-06e9-46b5-aaa9-a7d67273fb2f@intel.com> (raw)
In-Reply-To: <20250911-xe-iopoll-v3-4-6a95f1cc3b0b@intel.com>

On 9/11/2025 10:25 AM, Lucas De Marchi wrote:
> Move the error parsing and print out of guc_wait_ucode() into a helper
> to clean up the wait function.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

> ---
>   drivers/gpu/drm/xe/xe_guc.c | 81 ++++++++++++++++++++++-----------------------
>   1 file changed, 39 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index d8fc060c9682e..da1bb4939c6b8 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -1049,6 +1049,44 @@ static int guc_load_done(u32 status)
>   #endif
>   #define GUC_LOAD_TIME_WARN_MS      200
>   
> +static void print_bootrom_ukernel_err(struct xe_gt *gt, u32 bootrom, u32 ukernel)
> +{
> +	switch (bootrom) {
> +	case XE_BOOTROM_STATUS_NO_KEY_FOUND:
> +		xe_gt_err(gt, "invalid key requested, header = 0x%08X\n",
> +			  xe_mmio_read32(&gt->mmio, GUC_HEADER_INFO));
> +		break;
> +	case XE_BOOTROM_STATUS_RSA_FAILED:
> +		xe_gt_err(gt, "firmware signature verification failed\n");
> +		break;
> +	case XE_BOOTROM_STATUS_PROD_KEY_CHECK_FAILURE:
> +		xe_gt_err(gt, "firmware production part check failure\n");
> +		break;
> +	}
> +
> +	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(&gt->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_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;
> +	}
> +}
> +
>   static void guc_wait_ucode(struct xe_guc *guc)
>   {
>   	struct xe_gt *gt = guc_to_gt(guc);
> @@ -1114,48 +1152,7 @@ static void guc_wait_ucode(struct xe_guc *guc)
>   			  REG_FIELD_GET(GS_MIA_MASK, status),
>   			  REG_FIELD_GET(GS_AUTH_STATUS_MASK, status));
>   
> -		switch (bootrom) {
> -		case XE_BOOTROM_STATUS_NO_KEY_FOUND:
> -			xe_gt_err(gt, "invalid key requested, header = 0x%08X\n",
> -				  xe_mmio_read32(mmio, GUC_HEADER_INFO));
> -			break;
> -
> -		case XE_BOOTROM_STATUS_RSA_FAILED:
> -			xe_gt_err(gt, "firmware signature verification failed\n");
> -			break;
> -
> -		case XE_BOOTROM_STATUS_PROD_KEY_CHECK_FAILURE:
> -			xe_gt_err(gt, "firmware production part check failure\n");
> -			break;
> -		}
> -
> -		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_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;
> -		}
> -
> +		print_bootrom_ukernel_err(gt, bootrom, ukernel);
>   		xe_device_declare_wedged(gt_to_xe(gt));
>   	} else if (delta_ms > GUC_LOAD_TIME_WARN_MS) {
>   		xe_gt_warn(gt, "excessive init time: %lldms! [status = 0x%08X, timeouts = %d]\n",
>


  reply	other threads:[~2025-09-16 20:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 17:25 [PATCH v3 0/5] drm/xe: Use poll_timeout_us() Lucas De Marchi
2025-09-11 17:25 ` [PATCH v3 1/5] drm/xe/device: Use poll_timeout_us() to wait for lmem Lucas De Marchi
2025-09-11 17:25 ` [PATCH v3 2/5] drm/xe/guc_pc: Use poll_timeout_us() for waiting Lucas De Marchi
2025-09-11 21:21   ` Belgaumkar, Vinay
2025-09-12  4:56     ` Lucas De Marchi
2025-09-12 23:55       ` Belgaumkar, Vinay
2025-09-11 17:25 ` [PATCH v3 3/5] drm/xe/guc: Drop helper to read freq Lucas De Marchi
2025-09-11 17:25 ` [PATCH v3 4/5] drm/xe/guc: Extract function to print load error Lucas De Marchi
2025-09-16 20:06   ` John Harrison [this message]
2025-09-11 17:25 ` [PATCH v3 5/5] drm/xe/guc: Refactor GuC load to use poll_timeout_us() Lucas De Marchi
2025-09-16 20:03   ` John Harrison
2025-09-11 17:32 ` ✗ CI.checkpatch: warning for drm/xe: Use poll_timeout_us() (rev4) Patchwork
2025-09-11 17:33 ` ✓ CI.KUnit: success " Patchwork
2025-09-11 18:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-11 23:37 ` ✗ Xe.CI.Full: failure " 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=3f9169e9-06e9-46b5-aaa9-a7d67273fb2f@intel.com \
    --to=john.c.harrison@intel.com \
    --cc=dev@lankhorst.se \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=vinay.belgaumkar@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