Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniele Ceraolo Spurio" <daniele.ceraolospurio@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 3/6] drm/xe/uc: Add FW file fallback support
Date: Fri, 04 Dec 2026 19:59:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-250586@kernel.org> (raw)
In-Reply-To: <20261204193456.1035581-11-daniele.ceraolospurio@intel.com>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Low] drm/xe/uc: false fallback warning on user-overridden firmware
  path
- [Low] drm/xe/uc: uc_fw_vf_override() leaves stale wanted_path for
  xe_uc_fw_print()
- [Low] drm/xe: uc_fw_request() omits missing firmware filename on
  -ENOENT
- [Low] drm/xe: xe_uc_fw_check_version_requirements() misreports
  override as fallback
--

commit ea10bcbf948cd65162dcd530c37f512adf516565
Author: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

drm/xe/uc: Add FW file fallback support

This commit adds fallback support when loading uC firmware files so that
if the preferred firmware blob is missing, the driver can try older
matching entries in the firmware table while tracking both the wanted
and comparison versions.

> diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c
> index d0ea059239fa0..2099543021663 100644
> --- a/drivers/gpu/drm/xe/xe_uc_fw.c
> +++ b/drivers/gpu/drm/xe/xe_uc_fw.c

[ ... ]

> @@ -376,13 +397,21 @@ static int guc_read_css_info(struct xe_uc_fw *uc_fw, struct uc_css_guc_info *guc
>  int xe_uc_fw_check_version_requirements(struct xe_uc_fw *uc_fw)
>  {
>  	struct xe_device *xe = uc_fw_to_xe(uc_fw);
> -	struct xe_uc_fw_version *wanted = &uc_fw->versions.wanted;
> +	struct xe_uc_fw_version *wanted = &uc_fw->versions.comparison;
>  	struct xe_uc_fw_version *found = &uc_fw->versions.found[uc_fw->versions.wanted_type];
> +	bool need_update = false;
>  
>  	/* Driver has no requirement on any version, any is good. */
>  	if (!wanted->major)
>  		return 0;
>  
> +	if (uc_fw->wanted_path != uc_fw->path) {
> +		drm_notice(&xe->drm,
> +			   "%s firmware: using fallback path %s instead of the recommended %s\n",
> +			   xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, uc_fw->wanted_path);
> +		need_update = true;
> +	}

[Severity: Low]
Can this falsely warn about a fallback path when firmware is overridden
via module parameter?

In uc_fw_request(), uc_fw_override() replaces uc_fw->path with the
modparam pointer while leaving uc_fw->wanted_path pointing to the table
entry.  Because the pointers always differ, any overridden GuC or GSC
firmware emits the fallback notice and linux-firmware update message.

Guarding this check with !xe_uc_fw_is_overridden(uc_fw) would avoid that.

[ ... ]

> @@ -803,8 +843,8 @@ static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmwar
>  			       XE_UC_FIRMWARE_ERROR);
>  
>  	if (err == -ENOENT)
> -		xe_gt_info(gt, "%s firmware %s not found\n",
> -			   xe_uc_fw_type_repr(uc_fw->type), uc_fw->path);
> +		xe_gt_info(gt, "%s firmware not found\n",
> +			   xe_uc_fw_type_repr(uc_fw->type));
>  	else
>  		xe_gt_notice(gt, "%s firmware %s: fetch failed with error %pe\n",
>  			     xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, ERR_PTR(err));

[Severity: Low]
Does dropping the path here hide which firmware file is missing from
default dmesg logs?

firmware_request_nowarn() suppresses the loader's own warning and
fallback attempts only log at xe_gt_dbg(), so on -ENOENT dmesg no longer
reports the missing filename (even on single-entry platforms or with a
mistyped modparam override).

Exhausting the fallback loop also leaves uc_fw->path as NULL, so on
platforms >= XE_BATTLEMAGE where xe_gsc_init() continues without GSC
firmware, debugfs gsc_info prints (null) as the path.

Logging uc_fw->path ?: uc_fw->wanted_path (or restoring wanted_path on
exhaustion) would keep the filename visible.

[ ... ]

> @@ -1045,8 +1085,8 @@ void xe_uc_fw_print(struct xe_uc_fw *uc_fw, struct drm_printer *p)
>  {
>  	int i;
>  
> -	drm_printf(p, "%s firmware: %s\n",
> -		   xe_uc_fw_type_repr(uc_fw->type), uc_fw->path);
> +	drm_printf(p, "%s firmware: %s [wanted %s]\n",
> +		   xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, uc_fw->wanted_path);
>  	drm_printf(p, "\tstatus: %s\n",
>  		   xe_uc_fw_status_repr(uc_fw->status));

[Severity: Low]
Will this print stale host firmware paths on SR-IOV VFs and
[wanted (null)] for unsupported firmwares?

uc_fw_auto_select() sets uc_fw->wanted_path before the IS_SRIOV_VF(xe)
check in uc_fw_request(), and uc_fw_vf_override() only updates
uc_fw->path (to NULL for GSC and "Loaded by PF" for GuC/HuC) without
clearing uc_fw->wanted_path.

Clearing uc_fw->wanted_path in uc_fw_vf_override() and only printing
[wanted %s] when wanted_path is non-NULL and differs from path would
keep debugfs output consistent.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204193456.1035581-8-daniele.ceraolospurio@intel.com?part=3

  reply	other threads:[~2026-12-04 19:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 19:34 [PATCH v3 0/6] Add support for WCL GSC FW Daniele Ceraolo Spurio
2026-12-04 19:34 ` [PATCH v3 1/6] drm/xe/pxp: Fix PTL GSC version check for PXP support Daniele Ceraolo Spurio
2026-12-04 19:34 ` [PATCH v3 2/6] drm/xe: Define WCL as a PTL subplatform Daniele Ceraolo Spurio
2026-12-04 19:53   ` sashiko-bot
2026-12-04 19:35 ` [PATCH v3 3/6] drm/xe/uc: Add FW file fallback support Daniele Ceraolo Spurio
2026-12-04 19:59   ` sashiko-bot [this message]
2026-12-04 19:35 ` [PATCH v3 4/6] drm/xe/uc: mark HuC and GSC as only available on the media GT Daniele Ceraolo Spurio
2026-12-04 19:58   ` sashiko-bot
2026-12-04 19:35 ` [PATCH v3 5/6] drm/xe/uc: Support fetching different FW files per-subplatform Daniele Ceraolo Spurio
2026-12-04 19:56   ` sashiko-bot
2026-12-04 19:35 ` [PATCH v3 6/6] drm/xe/gsc: define GSC for WCL Daniele Ceraolo Spurio
2026-12-04 19:49 ` ✗ CI.checkpatch: warning for Add support for WCL GSC FW Patchwork
2026-12-04 19:51 ` ✓ CI.KUnit: success " 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-250586@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=daniele.ceraolospurio@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