From: Raag Jadav <raag.jadav@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: matthew.brost@intel.com, rodrigo.vivi@intel.com,
thomas.hellstrom@linux.intel.com, riana.tauro@intel.com,
michal.wajdeczko@intel.com, matthew.d.roper@intel.com,
michal.winiarski@intel.com, matthew.auld@intel.com,
dev@lankhorst.se, jani.nikula@intel.com, lukasz.laguna@intel.com,
zhanjun.dong@intel.com, lukas@wunner.de,
daniele.ceraolospurio@intel.com, badal.nilawar@intel.com,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v7 2/8] drm/xe/guc_submit: Introduce guc_exec_queue_reinit()
Date: Sat, 16 May 2026 15:01:25 +0530 [thread overview]
Message-ID: <20260516093131.27442-3-raag.jadav@intel.com> (raw)
In-Reply-To: <20260516093131.27442-1-raag.jadav@intel.com>
In preparation of usecases which require re-initializing GuC submission
after PCIe FLR, introduce guc_exec_queue_reinit() helper. This will restore
exec queues which might have been killed before PCIe FLR.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Tested-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
v4: Teardown exec queues instead of mangling scheduler pending list (Matthew Brost)
v5: Re-initialize kernel queues through submission backend (Matthew Brost)
---
drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++
drivers/gpu/drm/xe/xe_execlist.c | 6 ++++++
drivers/gpu/drm/xe/xe_gpu_scheduler.h | 5 +++++
drivers/gpu/drm/xe/xe_guc_submit.c | 13 +++++++++++++
4 files changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
index 2f5ccf294675..f1e45e8f30e7 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
@@ -274,6 +274,8 @@ struct xe_exec_queue {
struct xe_exec_queue_ops {
/** @init: Initialize exec queue for submission backend */
int (*init)(struct xe_exec_queue *q);
+ /** @reinit: Re-initialize exec queue for submission backend */
+ void (*reinit)(struct xe_exec_queue *q);
/** @kill: Kill inflight submissions for backend */
void (*kill)(struct xe_exec_queue *q);
/** @fini: Undoes the init() for submission backend */
diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c
index 9fb99c038ea8..1c9235a68f95 100644
--- a/drivers/gpu/drm/xe/xe_execlist.c
+++ b/drivers/gpu/drm/xe/xe_execlist.c
@@ -403,6 +403,11 @@ static void execlist_exec_queue_destroy_async(struct work_struct *w)
xe_exec_queue_fini(q);
}
+static void execlist_exec_queue_reinit(struct xe_exec_queue *q)
+{
+ /* NIY */
+}
+
static void execlist_exec_queue_kill(struct xe_exec_queue *q)
{
/* NIY */
@@ -466,6 +471,7 @@ static bool execlist_exec_queue_active(struct xe_exec_queue *q)
static const struct xe_exec_queue_ops execlist_exec_queue_ops = {
.init = execlist_exec_queue_init,
+ .reinit = execlist_exec_queue_reinit,
.kill = execlist_exec_queue_kill,
.fini = execlist_exec_queue_fini,
.destroy = execlist_exec_queue_destroy,
diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
index 664c2db56af3..1e079ca3891c 100644
--- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
+++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
@@ -51,6 +51,11 @@ static inline void xe_sched_tdr_queue_imm(struct xe_gpu_scheduler *sched)
drm_sched_tdr_queue_imm(&sched->base);
}
+static inline void xe_sched_update_timeout(struct xe_gpu_scheduler *sched, long timeout)
+{
+ sched->base.timeout = timeout;
+}
+
static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched)
{
struct drm_sched_job *s_job;
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 4171eff4e8ad..43eb414bcb26 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -2032,6 +2032,18 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
return err;
}
+static void guc_exec_queue_reinit(struct xe_exec_queue *q)
+{
+ struct xe_gpu_scheduler *sched = &q->guc->sched;
+ long timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT :
+ msecs_to_jiffies(q->sched_props.job_timeout_ms);
+
+ xe_gt_assert(guc_to_gt(exec_queue_to_guc(q)), drm_sched_is_stopped(&sched->base));
+
+ xe_sched_update_timeout(sched, timeout);
+ atomic_set(&q->guc->state, 0);
+}
+
static void guc_exec_queue_kill(struct xe_exec_queue *q)
{
trace_xe_exec_queue_kill(q);
@@ -2274,6 +2286,7 @@ static bool guc_exec_queue_active(struct xe_exec_queue *q)
*/
static const struct xe_exec_queue_ops guc_exec_queue_ops = {
.init = guc_exec_queue_init,
+ .reinit = guc_exec_queue_reinit,
.kill = guc_exec_queue_kill,
.fini = guc_exec_queue_fini,
.destroy = guc_exec_queue_destroy,
--
2.43.0
next prev parent reply other threads:[~2026-05-16 9:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 9:31 [PATCH v7 0/8] Introduce Xe PCIe FLR Raag Jadav
2026-05-16 9:31 ` [PATCH v7 1/8] drm/xe/uc_fw: Allow re-initializing firmware Raag Jadav
2026-05-16 9:31 ` Raag Jadav [this message]
2026-05-16 9:31 ` [PATCH v7 3/8] drm/xe/gt: Introduce FLR helpers Raag Jadav
2026-05-16 9:31 ` [PATCH v7 4/8] drm/xe/bo_evict: Introduce xe_bo_restore_map() Raag Jadav
2026-05-16 9:31 ` [PATCH v7 5/8] drm/xe/exec_queue: Introduce xe_exec_queue_reinit() Raag Jadav
2026-05-16 9:31 ` [PATCH v7 6/8] drm/xe/migrate: Introduce xe_migrate_reinit() Raag Jadav
2026-05-16 9:31 ` [PATCH v7 7/8] drm/xe/pm: Introduce xe_device_suspend/resume() Raag Jadav
2026-05-16 9:31 ` [PATCH v7 8/8] drm/xe/pci: Introduce PCIe FLR Raag Jadav
2026-05-16 9:41 ` ✗ CI.checkpatch: warning for Introduce Xe PCIe FLR (rev7) Patchwork
2026-05-16 9:42 ` ✓ CI.KUnit: success " Patchwork
2026-05-16 10:35 ` ✓ Xe.CI.BAT: " 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=20260516093131.27442-3-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=badal.nilawar@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=dev@lankhorst.se \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lukas@wunner.de \
--cc=lukasz.laguna@intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
--cc=zhanjun.dong@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