From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 136B6F99344 for ; Thu, 23 Apr 2026 10:03:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE10610F043; Thu, 23 Apr 2026 10:03:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="nTH0L5dv"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3034810F035 for ; Thu, 23 Apr 2026 10:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776938605; x=1808474605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y8U+NxrDAYXL1N7o1wOKEXljF2i/ZeTmD3K73C8Vywk=; b=nTH0L5dveQOb9a86NHzCQ5PhN80K075KUG7sRpcf7TMB2idDTcWdXn5t hYleH9WvY33hP5Yyu/BLcTLaXoEF1L9Dd5Fckl3sd+Nj4XN0KSUw01/r7 gOigc7J4iqFwJAY69xkOraLK5vS68ZWk0pWdQkbU7C+JZZtjEBskxjEY9 F81/5ATXD/yRLpcgK8yfCk7oPknAqTmY+b+Ggdl352a3r8c8rV1Yp0PLa G0wpMENBEOak35Q2EoQNXOorVMm1VKu07JkGbMHkhC7lKHbgOqFuzekJw FLMnGyHseAYcg2AOZm/h72OvjHhYwbRL82xnYMOSOWWhr0PNQF/PYC6Ry w==; X-CSE-ConnectionGUID: 2Ar3qxPlSauHUmWxqdU72g== X-CSE-MsgGUID: onoVWiZVSxiqRhySxoAiJw== X-IronPort-AV: E=McAfee;i="6800,10657,11764"; a="88600270" X-IronPort-AV: E=Sophos;i="6.23,194,1770624000"; d="scan'208";a="88600270" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2026 03:03:25 -0700 X-CSE-ConnectionGUID: s3SpUlvnRi2xOt7Pj/s59Q== X-CSE-MsgGUID: BD3vBwUyTbW70tVQRrhgmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,194,1770624000"; d="scan'208";a="232522781" Received: from jraag-z790m-itx-wifi.iind.intel.com ([10.190.239.23]) by orviesa008.jf.intel.com with ESMTP; 23 Apr 2026 03:03:21 -0700 From: Raag Jadav 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, maarten@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 Subject: [PATCH v6 2/8] drm/xe/guc_submit: Introduce guc_exec_queue_reinit() Date: Thu, 23 Apr 2026 15:30:11 +0530 Message-ID: <20260423100017.1051587-3-raag.jadav@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260423100017.1051587-1-raag.jadav@intel.com> References: <20260423100017.1051587-1-raag.jadav@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" 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 Tested-by: Lukasz Laguna --- 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 | 11 +++++++++++ 4 files changed, 24 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 755a2bff5d7b..cd5410db6fa2 100644 --- a/drivers/gpu/drm/xe/xe_execlist.c +++ b/drivers/gpu/drm/xe/xe_execlist.c @@ -413,6 +413,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 */ @@ -476,6 +481,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 b1222b42174c..5c96dd1f6e82 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -2053,6 +2053,16 @@ 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_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); @@ -2295,6 +2305,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