Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH v2] drm/xe/guc_submit: fixup deregister in job timeout
@ 2023-08-08  9:19 Matthew Auld
  2023-08-08 11:15 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Matthew Auld @ 2023-08-08  9:19 UTC (permalink / raw)
  To: intel-xe

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.

v2:
 - Drop the read_stopped() for this path. Since we are signalling
   fences on error here, best play it safe and wait for the GT reset to
   mark the engine as disabled, rather than it just being queued.

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

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 52c61f78b083..6126ddf2fdd5 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
@@ -901,8 +903,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 		 */
 		smp_rmb();
 		ret = wait_event_timeout(guc->ct.wq,
-					 !exec_queue_pending_disable(q) ||
-					 guc_read_stopped(guc), HZ * 5);
+					 !exec_queue_pending_disable(q),
+					 HZ * 5);
 		if (!ret) {
 			XE_WARN_ON("Schedule disable failed to respond");
 			sched->timeout = MIN_SCHED_TIMEOUT;
-- 
2.41.0


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

end of thread, other threads:[~2023-08-10 14:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08  9:19 [Intel-xe] [PATCH v2] drm/xe/guc_submit: fixup deregister in job timeout Matthew Auld
2023-08-08 11:15 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-08-08 11:15 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-08 11:16 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-08 11:20 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-08 11:21 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-08 11:21 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-08 13:54 ` [Intel-xe] ✓ CI.Patch_applied: success " Patchwork
2023-08-08 13:54 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-08 13:55 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-08 13:59 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-08 14:00 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-08 14:00 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-08 14:54 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-08-08 18:09 ` [Intel-xe] [PATCH v2] " Matthew Brost
2023-08-09  8:02   ` Matthew Auld
2023-08-10 14:12 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork

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