Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH v2 2/2] drm/xe/guc_submit: fixup deregister in job timeout
Date: Thu,  3 Aug 2023 18:38:51 +0100	[thread overview]
Message-ID: <20230803173849.285599-4-matthew.auld@intel.com> (raw)
In-Reply-To: <20230803173849.285599-3-matthew.auld@intel.com>

Rather check if the engine is still registered before proceeding with
deregister steps. Also the engine being marked as disabled doesn't mean
the engine has been disabled or deregistered from GuC pov, and here we
are signalling fences so we need to be sure GuC is not still using this
context.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index b88bfe7d8470..e499e6540ca5 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -881,15 +881,17 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	}
 
 	/* Engine state now stable, disable scheduling if needed */
-	if (exec_queue_enabled(q)) {
+	if (exec_queue_registered(q)) {
 		struct xe_guc *guc = exec_queue_to_guc(q);
 		int ret;
 
 		if (exec_queue_reset(q))
 			err = -EIO;
 		set_exec_queue_banned(q);
-		xe_exec_queue_get(q);
-		disable_scheduling_deregister(guc, q);
+		if (!exec_queue_destroyed(q)) {
+			xe_exec_queue_get(q);
+			disable_scheduling_deregister(guc, q);
+		}
 
 		/*
 		 * Must wait for scheduling to be disabled before signalling
-- 
2.41.0


  reply	other threads:[~2023-08-03 17:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 17:38 [Intel-xe] [PATCH v2 1/2] drm/xe/guc_submit: prevent repeated unregister Matthew Auld
2023-08-03 17:38 ` Matthew Auld [this message]
2023-08-03 18:32   ` [Intel-xe] [PATCH v2 2/2] drm/xe/guc_submit: fixup deregister in job timeout Matthew Brost
2023-08-04  8:48     ` Matthew Auld
2023-08-04 13:37       ` Matthew Brost
2023-08-04 15:03         ` Matthew Auld
2023-08-07 22:18           ` Matthew Brost
2023-08-03 17:41 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [v2,1/2] drm/xe/guc_submit: prevent repeated unregister Patchwork
2023-08-03 17:41 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-03 17:42 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-03 17:46 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-03 17:46 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-03 17:47 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-04  8:31 ` [Intel-xe] ○ CI.BAT: info " 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=20230803173849.285599-4-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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