Skip to contentSkip to conversation

Clean up some GuC related failure paths

PATCH In review [email protected] 3 participants 6 messages Feb 17, 2023 – Mar 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Clean up some GuC related failure paths

From: John Harrison <[email protected]>

Improve failure code handling during GuC intialisation.

v2: Fix function naming and improve on/off balancing (review feedback from Daniele)

John Harrison (2):
drm/i915/guc: Improve clean up of busyness stats worker drm/i915/guc: Fix missing return code checks in submission init

 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 133 +++++++++++++-----
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |   2 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |   7 +-
 3 files changed, 102 insertions(+), 40 deletions(-)
Signature · 1 line
2.39.1
#1 lore raw

PATCH v2 1/2 drm/i915/guc: Improve clean up of busyness stats worker

From: John Harrison <[email protected]>

The stats worker thread management was mis-matched between enable/disable call sites. Fix those up. Also, abstract the cancel/enable code into a helper function rather than replicating in multiple places.

v2: Rename the helpers and wrap the enable as well as the cancel (review feedback from Daniele).

---
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 38 +++++++++++--------
 1 file changed, 23 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +23 -15
index be495e657d66b..a04d7049a2c2f 100644
@@ -1352,6 +1352,16 @@ static ktime_t guc_engine_busyness(struct intel_engine_cs *engine, ktime_t *now)
 	return ns_to_ktime(total);
 }
 
+static void guc_enable_busyness_worker(struct intel_guc *guc)
+{
+	mod_delayed_work(system_highpri_wq, &guc->timestamp.work, guc->timestamp.ping_delay);
+}
+
+static void guc_cancel_busyness_worker(struct intel_guc *guc)
+{
+	cancel_delayed_work_sync(&guc->timestamp.work);
+}
+
 static void __reset_guc_busyness_stats(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
@@ -1360,7 +1370,7 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc)
 	unsigned long flags;
 	ktime_t unused;
 
-	cancel_delayed_work_sync(&guc->timestamp.work);
+	guc_cancel_busyness_worker(guc);
 
 	spin_lock_irqsave(&guc->timestamp.lock, flags);
 
@@ -1416,8 +1426,7 @@ static void guc_timestamp_ping(struct work_struct *wrk)
 
 	intel_gt_reset_unlock(gt, srcu);
 
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
+	guc_enable_busyness_worker(guc);
 }
 
 static int guc_action_enable_usage_stats(struct intel_guc *guc)
@@ -1436,16 +1445,15 @@ static void guc_init_engine_stats(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
 	intel_wakeref_t wakeref;
+	int ret;
 
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
-
-	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref) {
-		int ret = guc_action_enable_usage_stats(guc);
+	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
+		ret = guc_action_enable_usage_stats(guc);
 
-		if (ret)
-			guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
-	}
+	if (ret)
+		guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
+	else
+		guc_enable_busyness_worker(guc);
 }
 
 void intel_guc_busyness_park(struct intel_gt *gt)
@@ -1460,7 +1468,7 @@ void intel_guc_busyness_park(struct intel_gt *gt)
 	 * and causes an unclaimed register access warning. Cancel the worker
 	 * synchronously here.
 	 */
-	cancel_delayed_work_sync(&guc->timestamp.work);
+	guc_cancel_busyness_worker(guc);
 
 	/*
 	 * Before parking, we should sample engine busyness stats if we need to.
@@ -1487,8 +1495,7 @@ void intel_guc_busyness_unpark(struct intel_gt *gt)
 	spin_lock_irqsave(&guc->timestamp.lock, flags);
 	guc_update_pm_timestamp(guc, &unused);
 	spin_unlock_irqrestore(&guc->timestamp.lock, flags);
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
+	guc_enable_busyness_worker(guc);
 }
 
 static inline bool
@@ -4408,11 +4415,12 @@ void intel_guc_submission_enable(struct intel_guc *guc)
 	guc_init_global_schedule_policy(guc);
 }
 
+/* Note: By the time we're here, GuC may have already been reset */
 void intel_guc_submission_disable(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
 
-	/* Note: By the time we're here, GuC may have already been reset */
+	guc_cancel_busyness_worker(guc);
 
 	/* Disable and route to host */
 	if (GRAPHICS_VER(gt->i915) >= 12)
Signature · 1 line
2.39.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [Intel-gfx] [PATCH v2 1/2] drm/i915/guc: Improve clean up of busyness stats worker

Quoted 11 lines · On 2/17/2023 2:33 PM, [email protected] wrote:

From: John Harrison <[email protected]>

The stats worker thread management was mis-matched between enable/disable call sites. Fix those up. Also, abstract the cancel/enable code into a helper function rather than replicating in multiple places.

v2: Rename the helpers and wrap the enable as well as the cancel (review feedback from Daniele).

Daniele

Quoted 101 lines
---
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 38 +++++++++++--------
  1 file changed, 23 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +23 -15
index be495e657d66b..a04d7049a2c2f 100644
@@ -1352,6 +1352,16 @@ static ktime_t guc_engine_busyness(struct intel_engine_cs *engine, ktime_t *now)
  	return ns_to_ktime(total);
  }
 
+static void guc_enable_busyness_worker(struct intel_guc *guc)
+{
+	mod_delayed_work(system_highpri_wq, &guc->timestamp.work, guc->timestamp.ping_delay);
+}
+
+static void guc_cancel_busyness_worker(struct intel_guc *guc)
+{
+	cancel_delayed_work_sync(&guc->timestamp.work);
+}
+
  static void __reset_guc_busyness_stats(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
@@ -1360,7 +1370,7 @@ static void __reset_guc_busyness_stats(struct intel_guc *guc)
  	unsigned long flags;
  	ktime_t unused;
 
-	cancel_delayed_work_sync(&guc->timestamp.work);
+	guc_cancel_busyness_worker(guc);
 
  	spin_lock_irqsave(&guc->timestamp.lock, flags);
 
@@ -1416,8 +1426,7 @@ static void guc_timestamp_ping(struct work_struct *wrk)
 
  	intel_gt_reset_unlock(gt, srcu);
 
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
+	guc_enable_busyness_worker(guc);
  }
 
  static int guc_action_enable_usage_stats(struct intel_guc *guc)
@@ -1436,16 +1445,15 @@ static void guc_init_engine_stats(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
  	intel_wakeref_t wakeref;
+	int ret;
 
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
-
-	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref) {
-		int ret = guc_action_enable_usage_stats(guc);
+	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
+		ret = guc_action_enable_usage_stats(guc);
 
-		if (ret)
-			guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
-	}
+	if (ret)
+		guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
+	else
+		guc_enable_busyness_worker(guc);
  }
 
  void intel_guc_busyness_park(struct intel_gt *gt)
@@ -1460,7 +1468,7 @@ void intel_guc_busyness_park(struct intel_gt *gt)
  	 * and causes an unclaimed register access warning. Cancel the worker
  	 * synchronously here.
  	 */
-	cancel_delayed_work_sync(&guc->timestamp.work);
+	guc_cancel_busyness_worker(guc);
 
  	/*
  	 * Before parking, we should sample engine busyness stats if we need to.
@@ -1487,8 +1495,7 @@ void intel_guc_busyness_unpark(struct intel_gt *gt)
  	spin_lock_irqsave(&guc->timestamp.lock, flags);
  	guc_update_pm_timestamp(guc, &unused);
  	spin_unlock_irqrestore(&guc->timestamp.lock, flags);
-	mod_delayed_work(system_highpri_wq, &guc->timestamp.work,
-			 guc->timestamp.ping_delay);
+	guc_enable_busyness_worker(guc);
  }
 
  static inline bool
@@ -4408,11 +4415,12 @@ void intel_guc_submission_enable(struct intel_guc *guc)
  	guc_init_global_schedule_policy(guc);
  }
 
+/* Note: By the time we're here, GuC may have already been reset */
  void intel_guc_submission_disable(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
 
-	/* Note: By the time we're here, GuC may have already been reset */
+	guc_cancel_busyness_worker(guc);
 
  	/* Disable and route to host */
  	if (GRAPHICS_VER(gt->i915) >= 12)
#3 lore raw

PATCH v2 2/2 drm/i915/guc: Fix missing return code checks in submission init

In reply to [email protected]

From: John Harrison <[email protected]>

The CI results for the 'fast request' patch set (enables error return codes for fire-and-forget H2G messages) hit an issue with the KMD sending context submission requests on an invalid context. That was caused by a fault injection probe failing the context creation of a kernel context. However, there was no return code checking on any of the kernel context registration paths. So the driver kept going and tried to use the kernel context for the record defaults process.

This would not cause any actual problems. The invalid requests would be rejected by GuC and ultimately the start up sequence would correctly wedge due to the context creation failure. But fixing the issue correctly rather ignoring it means we won't get CI complaining when the fast request patch lands and enables the extra error checking.

So fix it by checking for errors and aborting as appropriate when creating kernel contexts. While at it, clean up some other submission init related failure cleanup paths. Also, rename guc_init_lrc_mapping to guc_init_submission as the former name hasn't been valid in a long time.

v2: Add another wrapper to keep the flow balanced (Daniele)

---
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 97 ++++++++++++++-----
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |  2 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  7 +-
 3 files changed, 80 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +74 -23
index a04d7049a2c2f..88e881b100cf0 100644
@@ -1441,7 +1441,7 @@ static int guc_action_enable_usage_stats(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static void guc_init_engine_stats(struct intel_guc *guc)
+static int guc_init_engine_stats(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
 	intel_wakeref_t wakeref;
@@ -1454,6 +1454,13 @@ static void guc_init_engine_stats(struct intel_guc *guc)
 		guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
 	else
 		guc_enable_busyness_worker(guc);
+
+	return ret;
+}
+
+static void guc_fini_engine_stats(struct intel_guc *guc)
+{
+	guc_cancel_busyness_worker(guc);
 }
 
 void intel_guc_busyness_park(struct intel_gt *gt)
@@ -4109,9 +4116,11 @@ static void guc_set_default_submission(struct intel_engine_cs *engine)
 	engine->submit_request = guc_submit_request;
 }
 
-static inline void guc_kernel_context_pin(struct intel_guc *guc,
-					  struct intel_context *ce)
+static inline int guc_kernel_context_pin(struct intel_guc *guc,
+					 struct intel_context *ce)
 {
+	int ret;
+
 	/*
 	 * Note: we purposefully do not check the returns below because
 	 * the registration can only fail if a reset is just starting.
@@ -4119,16 +4128,24 @@ static inline void guc_kernel_context_pin(struct intel_guc *guc,
 	 * isn't happening and even it did this code would be run again.
 	 */
 
-	if (context_guc_id_invalid(ce))
-		pin_guc_id(guc, ce);
+	if (context_guc_id_invalid(ce)) {
+		ret = pin_guc_id(guc, ce);
+
+		if (ret < 0)
+			return ret;
+	}
 
 	if (!test_bit(CONTEXT_GUC_INIT, &ce->flags))
 		guc_context_init(ce);
 
-	try_context_registration(ce, true);
+	ret = try_context_registration(ce, true);
+	if (ret)
+		unpin_guc_id(guc, ce);
+
+	return ret;
 }
 
-static inline void guc_init_lrc_mapping(struct intel_guc *guc)
+static inline int guc_init_submission(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
 	struct intel_engine_cs *engine;
@@ -4155,9 +4172,17 @@ static inline void guc_init_lrc_mapping(struct intel_guc *guc)
 		struct intel_context *ce;
 
 		list_for_each_entry(ce, &engine->pinned_contexts_list,
-				    pinned_contexts_link)
-			guc_kernel_context_pin(guc, ce);
+				    pinned_contexts_link) {
+			int ret = guc_kernel_context_pin(guc, ce);
+
+			if (ret) {
+				/* No point in trying to clean up as i915 will wedge on failure */
+				return ret;
+			}
+		}
 	}
+
+	return 0;
 }
 
 static void guc_release(struct intel_engine_cs *engine)
@@ -4400,31 +4425,57 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
 	return ret;
 }
 
-void intel_guc_submission_enable(struct intel_guc *guc)
+static void guc_route_semaphores(struct intel_guc *guc, bool to_guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
+	u32 val;
 
-	/* Enable and route to GuC */
-	if (GRAPHICS_VER(gt->i915) >= 12)
-		intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES,
-				   GUC_SEM_INTR_ROUTE_TO_GUC |
-				   GUC_SEM_INTR_ENABLE_ALL);
+	if (GRAPHICS_VER(gt->i915) < 12)
+		return;
+
+	if (to_guc)
+		val = GUC_SEM_INTR_ROUTE_TO_GUC | GUC_SEM_INTR_ENABLE_ALL;
+	else
+		val = 0;
+
+	intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES, val);
+}
+
+int intel_guc_submission_enable(struct intel_guc *guc)
+{
+	int ret;
+
+	/* Semaphore interrupt enable and route to GuC */
+	guc_route_semaphores(guc, true);
+
+	ret = guc_init_submission(guc);
+	if (ret)
+		goto fail_sem;
+
+	ret = guc_init_engine_stats(guc);
+	if (ret)
+		goto fail_sem;
+
+	ret = guc_init_global_schedule_policy(guc);
+	if (ret)
+		goto fail_stats;
 
-	guc_init_lrc_mapping(guc);
-	guc_init_engine_stats(guc);
-	guc_init_global_schedule_policy(guc);
+	return 0;
+
+fail_stats:
+	guc_fini_engine_stats(guc);
+fail_sem:
+	guc_route_semaphores(guc, false);
+	return ret;
 }
 
 /* Note: By the time we're here, GuC may have already been reset */
 void intel_guc_submission_disable(struct intel_guc *guc)
 {
-	struct intel_gt *gt = guc_to_gt(guc);
-
 	guc_cancel_busyness_worker(guc);
 
-	/* Disable and route to host */
-	if (GRAPHICS_VER(gt->i915) >= 12)
-		intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES, 0x0);
+	/* Semaphore interrupt disable and route to host */
+	guc_route_semaphores(guc, false);
 }
 
 static bool __guc_submission_supported(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -1
index 5a95a9f0a8e31..c57b29cdb1a64 100644
@@ -15,7 +15,7 @@ struct intel_engine_cs;
 
 void intel_guc_submission_init_early(struct intel_guc *guc);
 int intel_guc_submission_init(struct intel_guc *guc);
-void intel_guc_submission_enable(struct intel_guc *guc);
+int intel_guc_submission_enable(struct intel_guc *guc);
 void intel_guc_submission_disable(struct intel_guc *guc);
 void intel_guc_submission_fini(struct intel_guc *guc);
 int intel_guc_preempt_work_create(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_uc.c +5 -2
index 6648691bd6450..d42671dde53b3 100644
@@ -531,8 +531,11 @@ static int __uc_init_hw(struct intel_uc *uc)
 	else
 		intel_huc_auth(huc);
 
-	if (intel_uc_uses_guc_submission(uc))
-		intel_guc_submission_enable(guc);
+	if (intel_uc_uses_guc_submission(uc)) {
+		ret = intel_guc_submission_enable(guc);
+		if (ret)
+			goto err_log_capture;
+	}
 
 	if (intel_uc_uses_guc_slpc(uc)) {
 		ret = intel_guc_slpc_enable(&guc->slpc);
Signature · 1 line
2.39.1
Reviewed-by on v2 2/2
#4 lore raw

Re: [Intel-gfx] [PATCH v2 2/2] drm/i915/guc: Fix missing return code checks in submission init

Quoted 22 lines · On 2/17/2023 2:33 PM, [email protected] wrote:

From: John Harrison <[email protected]>

The CI results for the 'fast request' patch set (enables error return codes for fire-and-forget H2G messages) hit an issue with the KMD sending context submission requests on an invalid context. That was caused by a fault injection probe failing the context creation of a kernel context. However, there was no return code checking on any of the kernel context registration paths. So the driver kept going and tried to use the kernel context for the record defaults process.

This would not cause any actual problems. The invalid requests would be rejected by GuC and ultimately the start up sequence would correctly wedge due to the context creation failure. But fixing the issue correctly rather ignoring it means we won't get CI complaining when the fast request patch lands and enables the extra error checking.

So fix it by checking for errors and aborting as appropriate when creating kernel contexts. While at it, clean up some other submission init related failure cleanup paths. Also, rename guc_init_lrc_mapping to guc_init_submission as the former name hasn't been valid in a long time.

Quoted 3 lines

v2: Add another wrapper to keep the flow balanced (Daniele)

Daniele

Quoted 199 lines
---
  .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 97 ++++++++++++++-----
  .../gpu/drm/i915/gt/uc/intel_guc_submission.h |  2 +-
  drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  7 +-
  3 files changed, 80 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +74 -23
index a04d7049a2c2f..88e881b100cf0 100644
@@ -1441,7 +1441,7 @@ static int guc_action_enable_usage_stats(struct intel_guc *guc)
  	return intel_guc_send(guc, action, ARRAY_SIZE(action));
  }
 
-static void guc_init_engine_stats(struct intel_guc *guc)
+static int guc_init_engine_stats(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
  	intel_wakeref_t wakeref;
@@ -1454,6 +1454,13 @@ static void guc_init_engine_stats(struct intel_guc *guc)
  		guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
  	else
  		guc_enable_busyness_worker(guc);
+
+	return ret;
+}
+
+static void guc_fini_engine_stats(struct intel_guc *guc)
+{
+	guc_cancel_busyness_worker(guc);
  }
 
  void intel_guc_busyness_park(struct intel_gt *gt)
@@ -4109,9 +4116,11 @@ static void guc_set_default_submission(struct intel_engine_cs *engine)
  	engine->submit_request = guc_submit_request;
  }
 
-static inline void guc_kernel_context_pin(struct intel_guc *guc,
-					  struct intel_context *ce)
+static inline int guc_kernel_context_pin(struct intel_guc *guc,
+					 struct intel_context *ce)
  {
+	int ret;
+
  	/*
  	 * Note: we purposefully do not check the returns below because
  	 * the registration can only fail if a reset is just starting.
@@ -4119,16 +4128,24 @@ static inline void guc_kernel_context_pin(struct intel_guc *guc,
  	 * isn't happening and even it did this code would be run again.
  	 */
 
-	if (context_guc_id_invalid(ce))
-		pin_guc_id(guc, ce);
+	if (context_guc_id_invalid(ce)) {
+		ret = pin_guc_id(guc, ce);
+
+		if (ret < 0)
+			return ret;
+	}
 
  	if (!test_bit(CONTEXT_GUC_INIT, &ce->flags))
  		guc_context_init(ce);
 
-	try_context_registration(ce, true);
+	ret = try_context_registration(ce, true);
+	if (ret)
+		unpin_guc_id(guc, ce);
+
+	return ret;
  }
 
-static inline void guc_init_lrc_mapping(struct intel_guc *guc)
+static inline int guc_init_submission(struct intel_guc *guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
  	struct intel_engine_cs *engine;
@@ -4155,9 +4172,17 @@ static inline void guc_init_lrc_mapping(struct intel_guc *guc)
  		struct intel_context *ce;
 
  		list_for_each_entry(ce, &engine->pinned_contexts_list,
-				    pinned_contexts_link)
-			guc_kernel_context_pin(guc, ce);
+				    pinned_contexts_link) {
+			int ret = guc_kernel_context_pin(guc, ce);
+
+			if (ret) {
+				/* No point in trying to clean up as i915 will wedge on failure */
+				return ret;
+			}
+		}
  	}
+
+	return 0;
  }
 
  static void guc_release(struct intel_engine_cs *engine)
@@ -4400,31 +4425,57 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
  	return ret;
  }
 
-void intel_guc_submission_enable(struct intel_guc *guc)
+static void guc_route_semaphores(struct intel_guc *guc, bool to_guc)
  {
  	struct intel_gt *gt = guc_to_gt(guc);
+	u32 val;
 
-	/* Enable and route to GuC */
-	if (GRAPHICS_VER(gt->i915) >= 12)
-		intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES,
-				   GUC_SEM_INTR_ROUTE_TO_GUC |
-				   GUC_SEM_INTR_ENABLE_ALL);
+	if (GRAPHICS_VER(gt->i915) < 12)
+		return;
+
+	if (to_guc)
+		val = GUC_SEM_INTR_ROUTE_TO_GUC | GUC_SEM_INTR_ENABLE_ALL;
+	else
+		val = 0;
+
+	intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES, val);
+}
+
+int intel_guc_submission_enable(struct intel_guc *guc)
+{
+	int ret;
+
+	/* Semaphore interrupt enable and route to GuC */
+	guc_route_semaphores(guc, true);
+
+	ret = guc_init_submission(guc);
+	if (ret)
+		goto fail_sem;
+
+	ret = guc_init_engine_stats(guc);
+	if (ret)
+		goto fail_sem;
+
+	ret = guc_init_global_schedule_policy(guc);
+	if (ret)
+		goto fail_stats;
 
-	guc_init_lrc_mapping(guc);
-	guc_init_engine_stats(guc);
-	guc_init_global_schedule_policy(guc);
+	return 0;
+
+fail_stats:
+	guc_fini_engine_stats(guc);
+fail_sem:
+	guc_route_semaphores(guc, false);
+	return ret;
  }
 
  /* Note: By the time we're here, GuC may have already been reset */
  void intel_guc_submission_disable(struct intel_guc *guc)
  {
-	struct intel_gt *gt = guc_to_gt(guc);
-
  	guc_cancel_busyness_worker(guc);
 
-	/* Disable and route to host */
-	if (GRAPHICS_VER(gt->i915) >= 12)
-		intel_uncore_write(gt->uncore, GEN12_GUC_SEM_INTR_ENABLES, 0x0);
+	/* Semaphore interrupt disable and route to host */
+	guc_route_semaphores(guc, false);
  }
 
  static bool __guc_submission_supported(struct intel_guc *guc)
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +1 -1
index 5a95a9f0a8e31..c57b29cdb1a64 100644
@@ -15,7 +15,7 @@ struct intel_engine_cs;
 
  void intel_guc_submission_init_early(struct intel_guc *guc);
  int intel_guc_submission_init(struct intel_guc *guc);
-void intel_guc_submission_enable(struct intel_guc *guc);
+int intel_guc_submission_enable(struct intel_guc *guc);
  void intel_guc_submission_disable(struct intel_guc *guc);
  void intel_guc_submission_fini(struct intel_guc *guc);
  int intel_guc_preempt_work_create(struct intel_guc *guc);
drivers/gpu/drm/i915/gt/uc/intel_uc.c +5 -2
index 6648691bd6450..d42671dde53b3 100644
@@ -531,8 +531,11 @@ static int __uc_init_hw(struct intel_uc *uc)
  	else
  		intel_huc_auth(huc);
 
-	if (intel_uc_uses_guc_submission(uc))
-		intel_guc_submission_enable(guc);
+	if (intel_uc_uses_guc_submission(uc)) {
+		ret = intel_guc_submission_enable(guc);
+		if (ret)
+			goto err_log_capture;
+	}
 
  	if (intel_uc_uses_guc_slpc(uc)) {
  		ret = intel_guc_slpc_enable(&guc->slpc);
#5 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for Clean up some GuC related failure paths (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: Clean up some GuC related failure paths (rev2)
URL : https://patchwork.freedesktop.org/series/112708/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12759 -> Patchwork_112708v2
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_112708v2 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_112708v2, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/index.html

Participating hosts (38 -> 38)
------------------------------

Additional (2): bat-atsm-1 fi-pnv-d510
Missing (2): fi-bsw-nick fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_112708v2:

### IGT changes ###

#### Possible regressions ####

* igt@gem_basic@create-close:
- fi-blb-e6850: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/fi-blb-e6850/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-blb-e6850/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_112708v2 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@fbdev@eof:
- bat-atsm-1: NOTRUN -> [SKIP][3] ([i915#2582]) +4 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@gem_mmap@basic:
- bat-atsm-1: NOTRUN -> [SKIP][4] ([i915#4083])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@gem_tiled_fence_blits@basic:
- bat-atsm-1: NOTRUN -> [SKIP][5] ([i915#4077]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@gem_tiled_pread_basic:
- bat-atsm-1: NOTRUN -> [SKIP][6] ([i915#4079]) +1 similar issue
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@gem_tiled_pread_basic.html

* igt@i915_pm_rpm@basic-rte:
- bat-adlp-6: [PASS][7] -> [ABORT][8] ([i915#7977])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/bat-adlp-6/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-adlp-6/igt@[email protected]

* igt@i915_pm_rps@basic-api:
- bat-atsm-1: NOTRUN -> [SKIP][9] ([i915#6621])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@i915_selftest@live@execlists:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][10] ([i915#7156] / [i915#7913])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-kbl-soraka/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka: [PASS][11] -> [DMESG-FAIL][12] ([i915#5334] / [i915#7872])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_suspend@basic-s3-without-i915:
- bat-atsm-1: NOTRUN -> [SKIP][13] ([i915#6645])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_addfb_basic@size-max:
- bat-atsm-1: NOTRUN -> [SKIP][14] ([i915#6077]) +36 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-dg2-11: NOTRUN -> [SKIP][15] ([i915#7828])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-dg2-11/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor:
- bat-atsm-1: NOTRUN -> [SKIP][16] ([i915#6078]) +14 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_flip@basic-plain-flip:
- bat-atsm-1: NOTRUN -> [SKIP][17] ([i915#6166]) +3 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- bat-atsm-1: NOTRUN -> [SKIP][18] ([i915#6093]) +3 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc:
- bat-atsm-1: NOTRUN -> [SKIP][19] ([i915#1836]) +6 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_prop_blob@basic:
- bat-atsm-1: NOTRUN -> [SKIP][20] ([i915#7357])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@kms_psr@primary_page_flip:
- fi-pnv-d510: NOTRUN -> [SKIP][21] ([fdo#109271]) +44 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-pnv-d510/igt@kms_psr@primary_page_flip.html

* igt@kms_psr@sprite_plane_onoff:
- bat-atsm-1: NOTRUN -> [SKIP][22] ([i915#1072]) +3 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@kms_psr@sprite_plane_onoff.html

* igt@kms_setmode@basic-clone-single-crtc:
- bat-atsm-1: NOTRUN -> [SKIP][23] ([i915#6094])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- bat-atsm-1: NOTRUN -> [SKIP][24] ([fdo#109295] / [i915#6078])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-fence-mmap:
- bat-atsm-1: NOTRUN -> [SKIP][25] ([fdo#109295] / [i915#4077]) +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

* igt@prime_vgem@basic-write:
- bat-atsm-1: NOTRUN -> [SKIP][26] ([fdo#109295]) +3 similar issues
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-atsm-1/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-glk-j4005: [DMESG-FAIL][27] ([i915#5334]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@gt_lrc:
- bat-dg2-11: [INCOMPLETE][29] ([i915#7609] / [i915#7913]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@requests:
- fi-kbl-soraka: [ABORT][31] ([i915#7913]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/fi-kbl-soraka/igt@i915_selftest@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/fi-kbl-soraka/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_selftest@live@requests:
- bat-rpls-1: [ABORT][33] ([i915#4983] / [i915#7911]) -> [ABORT][34] ([i915#4983] / [i915#7911] / [i915#7981])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12759/bat-rpls-1/igt@i915_selftest@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/bat-rpls-1/igt@i915_selftest@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1836]: https://gitlab.freedesktop.org/drm/intel/issues/1836
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6077]: https://gitlab.freedesktop.org/drm/intel/issues/6077
[i915#6078]: https://gitlab.freedesktop.org/drm/intel/issues/6078
[i915#6093]: https://gitlab.freedesktop.org/drm/intel/issues/6093
[i915#6094]: https://gitlab.freedesktop.org/drm/intel/issues/6094
[i915#6166]: https://gitlab.freedesktop.org/drm/intel/issues/6166
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#7156]: https://gitlab.freedesktop.org/drm/intel/issues/7156
[i915#7357]: https://gitlab.freedesktop.org/drm/intel/issues/7357
[i915#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
[i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7977]: https://gitlab.freedesktop.org/drm/intel/issues/7977
[i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981

Build changes
-------------

* Linux: CI_DRM_12759 -> Patchwork_112708v2

CI-20190529: 20190529
CI_DRM_12759: 00e12ed04ecb81a67099d4c4833c86186ca7d31e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7165: 509e7e63c6377d0fe77d1bd209857fb191f4a84c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112708v2: 00e12ed04ecb81a67099d4c4833c86186ca7d31e @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

96226efa3c84 drm/i915/guc: Fix missing return code checks in submission init 011fdd49b953 drm/i915/guc: Improve clean up of busyness stats worker

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112708v2/index.html