From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Raag Jadav <raag.jadav@intel.com>, <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>, <badal.nilawar@intel.com>
Subject: Re: [PATCH v8 02/10] drm/xe/guc_submit: Introduce guc_exec_queue_reinit_kernel()
Date: Thu, 25 Jun 2026 16:46:49 -0700 [thread overview]
Message-ID: <3fa673c3-af1d-495f-8f42-4a3bde0d442a@intel.com> (raw)
In-Reply-To: <20260603101814.916948-3-raag.jadav@intel.com>
On 6/3/2026 3:17 AM, Raag Jadav wrote:
> In preparation of usecases which require re-initializing GuC submission
> after PCIe FLR, introduce guc_exec_queue_reinit_kernel() helper. This will
> restore kernel 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)
> v8: Introduce xe_sched_reinit() (Daniele)
> Maintain timeout per scheduler instance (Daniele)
> s/reinit/reinit_kernel (Daniele)
> ---
> 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.c | 6 ++++++
> drivers/gpu/drm/xe/xe_gpu_scheduler.h | 1 +
> drivers/gpu/drm/xe/xe_gpu_scheduler_types.h | 5 +++++
> drivers/gpu/drm/xe/xe_guc_submit.c | 12 ++++++++++++
> 6 files changed, 32 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..cca1ded68db7 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_kernel: Re-initialize kernel queue for submission backend */
> + void (*reinit_kernel)(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..f67b55782993 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_kernel(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_kernel = execlist_exec_queue_reinit_kernel,
> .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.c b/drivers/gpu/drm/xe/xe_gpu_scheduler.c
> index 67d8ce368486..1e38cfa19a58 100644
> --- a/drivers/gpu/drm/xe/xe_gpu_scheduler.c
> +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.c
> @@ -76,6 +76,7 @@ int xe_sched_init(struct xe_gpu_scheduler *sched,
> };
>
> sched->ops = xe_ops;
> + sched->timeout = timeout;
> spin_lock_init(&sched->msg_lock);
> INIT_LIST_HEAD(&sched->msgs);
> INIT_WORK(&sched->work_process_msg, xe_sched_process_msg_work);
> @@ -83,6 +84,11 @@ int xe_sched_init(struct xe_gpu_scheduler *sched,
> return drm_sched_init(&sched->base, &args);
> }
>
> +void xe_sched_reinit(struct xe_gpu_scheduler *sched)
> +{
> + sched->base.timeout = sched->timeout;
IMO long term we should probably have a more generic drm_sched_reinit
call in the common code, so that if new fields are added that need to be
updated on re-init they are automatically handled, but we can probably
do that as a follow-up.
> +}
> +
> void xe_sched_fini(struct xe_gpu_scheduler *sched)
> {
> xe_sched_submission_stop(sched);
> diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
> index 664c2db56af3..22e24b4b7171 100644
> --- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
> +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
> @@ -17,6 +17,7 @@ int xe_sched_init(struct xe_gpu_scheduler *sched,
> long timeout, struct workqueue_struct *timeout_wq,
> atomic_t *score, const char *name,
> struct device *dev);
> +void xe_sched_reinit(struct xe_gpu_scheduler *sched);
> void xe_sched_fini(struct xe_gpu_scheduler *sched);
>
> void xe_sched_submission_start(struct xe_gpu_scheduler *sched);
> diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h b/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
> index 63d9bf92583c..e73fdacca164 100644
> --- a/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
> +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
> @@ -51,6 +51,11 @@ struct xe_gpu_scheduler {
> spinlock_t msg_lock;
> /** @work_process_msg: processes messages */
> struct work_struct work_process_msg;
> + /**
> + * @timeout: timeout for the scheduler instance, to be restored
> + * during exec queue re-initialization
> + */
> + long timeout;
> };
>
> #define xe_sched_entity drm_sched_entity
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index ab501513d806..2c514f2bdda7 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2040,6 +2040,17 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
> return err;
> }
>
> +static void guc_exec_queue_reinit_kernel(struct xe_exec_queue *q)
> +{
> + struct xe_gpu_scheduler *sched = &q->guc->sched;
> +
> + xe_gt_assert(guc_to_gt(exec_queue_to_guc(q)), drm_sched_is_stopped(&sched->base));
This assert should be in xe_sched_reinit. with that:
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Daniele
> + xe_gt_assert(guc_to_gt(exec_queue_to_guc(q)), q->flags & EXEC_QUEUE_FLAG_KERNEL);
> +
> + atomic_set(&q->guc->state, 0);
> + xe_sched_reinit(sched);
> +}
> +
> static void guc_exec_queue_kill(struct xe_exec_queue *q)
> {
> trace_xe_exec_queue_kill(q);
> @@ -2282,6 +2293,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_kernel = guc_exec_queue_reinit_kernel,
> .kill = guc_exec_queue_kill,
> .fini = guc_exec_queue_fini,
> .destroy = guc_exec_queue_destroy,
next prev parent reply other threads:[~2026-06-25 23:46 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 10:17 [PATCH v8 00/10] Introduce Xe PCIe FLR Raag Jadav
2026-06-03 10:17 ` [PATCH v8 01/10] drm/xe/uc_fw: Allow re-initializing firmware Raag Jadav
2026-06-25 23:40 ` Daniele Ceraolo Spurio
2026-06-03 10:17 ` [PATCH v8 02/10] drm/xe/guc_submit: Introduce guc_exec_queue_reinit_kernel() Raag Jadav
2026-06-25 23:46 ` Daniele Ceraolo Spurio [this message]
2026-06-03 10:17 ` [PATCH v8 03/10] drm/xe/gt: Introduce FLR helpers Raag Jadav
2026-06-03 10:17 ` [PATCH v8 04/10] drm/xe/bo_evict: Introduce xe_bo_restore_map() Raag Jadav
2026-07-01 5:21 ` Gupta, Varun
2026-06-03 10:17 ` [PATCH v8 05/10] drm/xe/exec_queue: Introduce xe_exec_queue_reinit() Raag Jadav
2026-06-26 0:06 ` Daniele Ceraolo Spurio
2026-06-29 12:23 ` Raag Jadav
2026-06-03 10:17 ` [PATCH v8 06/10] drm/xe/migrate: Introduce xe_migrate_reinit() Raag Jadav
2026-06-03 10:17 ` [PATCH v8 07/10] drm/xe/pm: Introduce xe_device_suspend/resume() Raag Jadav
2026-06-03 10:58 ` Rodrigo Vivi
2026-06-03 10:17 ` [PATCH v8 08/10] drm/xe: Improve wedged state management Raag Jadav
2026-06-03 10:56 ` Rodrigo Vivi
2026-06-04 6:52 ` Tauro, Riana
2026-06-04 8:39 ` Raag Jadav
2026-06-17 5:58 ` Tauro, Riana
2026-06-17 6:11 ` Matthew Brost
2026-06-03 10:17 ` [PATCH v8 09/10] drm/xe/pci: Introduce PCIe FLR Raag Jadav
2026-06-03 10:40 ` Rodrigo Vivi
2026-06-03 10:17 ` [PATCH v8 10/10] drm/xe/doc: Wire up PCI Error Handling Raag Jadav
2026-06-03 10:28 ` ✗ CI.checkpatch: warning for Introduce Xe PCIe FLR (rev8) Patchwork
2026-06-03 10:29 ` ✓ CI.KUnit: success " Patchwork
2026-06-03 11:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-03 22:55 ` ✓ 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=3fa673c3-af1d-495f-8f42-4a3bde0d442a@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=badal.nilawar@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=raag.jadav@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.