Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/xe_late_bind_fw: Skip OCODE late bind if same version is already running
@ 2026-11-17 12:59 Sk Anirban
  2026-11-17 13:24 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sk Anirban @ 2026-11-17 12:59 UTC (permalink / raw)
  To: intel-xe
  Cc: anshuman.gupta, badal.nilawar, riana.tauro, karthik.poosa,
	raag.jadav, soham.purkait, mallesh.koujalagi, Sk Anirban

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;
+}
+
 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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-17 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox