Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Sk Anirban <sk.anirban@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <riana.tauro@intel.com>,
	<karthik.poosa@intel.com>, <raag.jadav@intel.com>,
	<soham.purkait@intel.com>,  <mallesh.koujalagi@intel.com>
Subject: Re: [PATCH] drm/xe/xe_late_bind_fw: Skip OCODE late bind if same version is already running
Date: Wed, 18 Nov 2026 14:44:36 +0530	[thread overview]
Message-ID: <d10b53db-a1ca-4e6a-b5ce-9040e6e29b45@intel.com> (raw)
In-Reply-To: <20261117125904.2877468-2-sk.anirban@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]


On 17-11-2026 18:29, Sk Anirban wrote:
> Late binding currently uploads OCODE without checking what is already
> running. Before the upload, check whether OCODE is initialized and
> compare its version with the payload's. Skip the push when they
> match.
>
> Signed-off-by: Sk Anirban<sk.anirban@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_late_bind_fw.c | 31 ++++++++++++++++++++++++++++
>   1 file changed, 31 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> index 355d7c841871..4b8c48871d8c 100644
> --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> @@ -246,6 +246,31 @@ static void wait_for_worker_completion(struct xe_late_bind *late_bind)
>   	}
>   }
>   
> +static bool xe_late_bind_ocode_is_current(struct xe_late_bind_fw *lbfw)
> +{
> +	struct xe_device *xe = late_bind_fw_to_xe(lbfw);
> +	u16 running_ver;
> +	int ret;
> +
> +	if (lbfw->type != INTEL_LB_TYPE_OCODE || !xe->info.has_sysctrl)
> +		return false;
> +
> +	if (!xe_sysctrl_is_oobmsm_fw_ready(xe))
> +		return false;
> +
> +	ret = xe_sysctrl_sdk_api_version(xe, &running_ver);
> +	if (ret) {
> +		drm_dbg(&xe->drm, "Failed to get running OCODE SDK API version: %pe\n",
> +			ERR_PTR(ret));
> +		return false;
> +	}
> +
> +	drm_dbg(&xe->drm, "OCODE SDK API version running %u, payload %u\n",
> +		running_ver, lbfw->sdk_api_version);
> +
> +	return running_ver == lbfw->sdk_api_version;

|sdk_api_version|is not the OCode firmware version. Please compare the 
running version with all four |lb_fw->version| fields.

Thanks,
Badal

> +}
> +
>   static void xe_late_bind_work(struct work_struct *work)
>   {
>   	struct xe_late_bind_fw *lbfw = container_of(work, struct xe_late_bind_fw, work);
> @@ -258,6 +283,12 @@ static void xe_late_bind_work(struct work_struct *work)
>   
>   	xe_device_assert_mem_access(xe);
>   
> +	if (xe_late_bind_ocode_is_current(lbfw)) {
> +		drm_dbg(&xe->drm, "%s firmware already loaded, skipping\n",
> +			fw_id_to_name[lbfw->id]);
> +		goto out;
> +	}
> +
>   	/* we can queue this before the component is bound */
>   	for (slept = 0; slept < LB_INIT_TIMEOUT_MS; slept += 100) {
>   		if (late_bind->component.ops)

[-- Attachment #2: Type: text/html, Size: 3416 bytes --]

      parent reply	other threads:[~2026-11-18  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:59 [PATCH] drm/xe/xe_late_bind_fw: Skip OCODE late bind if same version is already running Sk Anirban
2026-11-17 13:24 ` ✓ CI.KUnit: success for " Patchwork
2026-11-17 13:29 ` [PATCH] " sashiko-bot
2026-11-17 13:55 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-11-17 15:27 ` [PATCH] " Rodrigo Vivi
2026-11-18  2:23 ` ✓ Xe.CI.FULL: success for " Patchwork
2026-11-18  9:14 ` Nilawar, Badal [this message]

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=d10b53db-a1ca-4e6a-b5ce-9040e6e29b45@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=mallesh.koujalagi@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@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