Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Badal Nilawar" <badal.nilawar@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v5 3/5] drm/xe/xe_late_bind_fw: Add support to load Ocode firmware
Date: Wed, 28 Oct 2026 18:31:56 +0000	[thread overview]
Message-ID: <sashiko-outbox-188293@kernel.org> (raw)
In-Reply-To: <20261028181951.1093283-10-badal.nilawar@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] drm/xe: unreachable INTEL_LB_STATUS_IP_ERROR_START and missing status in xe_late_bind_parse_status()
--

commit 24b78786ca211ddb93b253dbb3bc2c006a8f78c6
Author: Badal Nilawar <badal.nilawar@intel.com>

drm/xe/xe_late_bind_fw: Add support to load Ocode firmware

This commit enables loading the Ocode firmware through the late binding
flow by querying the SDK API version from the System Controller mailbox
and verifying it against the firmware manifest. It also removes the 4K
payload size limit and expands the status string table in
xe_late_bind_parse_status().

> diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> index 881a46abc4f51..39c47b743edc9 100644
> --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
[ ... ]
> @@ -179,6 +188,34 @@ static const char *xe_late_bind_parse_status(uint32_t status)
>  		return "Invalid Payload";
>  	case INTEL_LB_STATUS_TIMEOUT:
>  		return "Timeout";
> +	case INTEL_LB_STATUS_INTERNAL_ERROR:
> +		return "Internal Error";
> +	case INTEL_LB_STATUS_INVALID_FPT_TABLE:
> +		return "Invalid FPT Table";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_VERIFICATION_ERROR:
> +		return "Signed Payload Verification Error";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_INVALID_CPD:
> +		return "Signed Payload Invalid CPD";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_FW_VERSION_MISMATCH:
> +		return "Signed Payload FW Version Mismatch";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_INVALID_MANIFEST:
> +		return "Signed Payload Invalid Manifest";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_INVALID_HASH:
> +		return "Signed Payload Invalid Hash";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_BINDING_TYPE_MISMATCH:
> +		return "Signed Payload Binding type Mismatch";
> +	case INTEL_LB_STATUS_SIGNED_PAYLOAD_HANDLE_SVN_FAILED:
> +		return "Signed Payload Handle SVN Failed";
> +	case INTEL_LB_STATUS_DESTINATION_MBOX_FAILURE:
> +		return "Destination MBOX Failure";
> +	case INTEL_LB_STATUS_MISSING_LOADING_PATCH:
> +		return "Missing Loading Patch";
> +	case INTEL_LB_STATUS_INVALID_COMMAND:
> +		return "Invalid Command";
> +	case INTEL_LB_STATUS_INVALID_HECI_HEADER:
> +		return "Invalid HECI Header";
> +	case INTEL_LB_STATUS_IP_ERROR_START:
> +		return "IP Error Start";

[Severity: Low]
Can the INTEL_LB_STATUS_IP_ERROR_START case in xe_late_bind_parse_status()
ever be reached?

In include/drm/intel/intel_lb_mei_interface.h, enum intel_lb_status defines
INTEL_LB_STATUS_IP_ERROR_START as BIT(31):

	INTEL_LB_STATUS_TIMEOUT                              = 7,
	INTEL_LB_STATUS_BUFFER_TOO_SMALL                     = 8,
	INTEL_LB_STATUS_INTERNAL_ERROR                       = 9,
	...
	INTEL_LB_STATUS_IP_ERROR_START                       = BIT(31),

However, in drivers/gpu/drm/xe/xe_late_bind_fw.c, the sole caller
xe_late_bind_work() stores the return value of push_payload() in a signed
int and only invokes xe_late_bind_parse_status() when ret > 0:

	if (ret > 0)
		drm_err(&xe->drm, "Load %s firmware failed with err %d, %s\n",
			fw_id_to_name[lbfw->id], ret, xe_late_bind_parse_status(ret));
	else
		drm_err(&xe->drm, "Load %s firmware failed with err %d",
			fw_id_to_name[lbfw->id], ret);

Because BIT(31) is negative when stored in a signed 32-bit int, a failure
returning INTEL_LB_STATUS_IP_ERROR_START will take the else branch instead
of calling xe_late_bind_parse_status().

Also, should INTEL_LB_STATUS_BUFFER_TOO_SMALL (8), which sits between
INTEL_LB_STATUS_TIMEOUT (7) and INTEL_LB_STATUS_INTERNAL_ERROR (9) in
enum intel_lb_status, be included in this switch statement so it does not
fall through to "Unknown error"?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028181951.1093283-7-badal.nilawar@intel.com?part=3

  reply	other threads:[~2026-10-28 18:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 18:19 [PATCH v5 0/5] Add ocode late binding support for CRI Badal Nilawar
2026-10-28 18:19 ` [PATCH v5 1/5] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry Badal Nilawar
2026-10-28 20:56   ` Ceraolo Spurio, Daniele
2026-10-28 18:19 ` [PATCH v5 2/5] drm/xe/xe_late_bind_fw: Convert late bind flag to mask Badal Nilawar
2026-10-28 18:19 ` [PATCH v5 3/5] drm/xe/xe_late_bind_fw: Add support to load Ocode firmware Badal Nilawar
2026-10-28 18:31   ` sashiko-bot [this message]
2026-10-29 16:43   ` Ceraolo Spurio, Daniele
2026-10-28 18:19 ` [PATCH v5 4/5] drm/xe/xe_late_bind_fw: Enable late binding support for CRI Badal Nilawar
2026-10-28 18:29   ` sashiko-bot
2026-10-28 22:58   ` Ceraolo Spurio, Daniele
2026-10-28 18:19 ` [PATCH v5 5/5] drm/xe/xe_late_bind_fw: Refactor pm flow Badal Nilawar
2026-10-28 18:29 ` ✓ CI.KUnit: success for Add ocode late binding support for CRI (rev5) Patchwork
2026-10-28 19:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-29  5:03 ` ✓ Xe.CI.FULL: " 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=sashiko-outbox-188293@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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