[PATCH 17/22] drm/i915/guc: Disable GuC submission and suspend it prior to i915 reset

Sagar Arun Kamble sagar.a.kamble at intel.com
Thu Oct 5 11:22:10 UTC 2017

Before i915 reset, we need to disable GuC submission and suspend GuC
operations as it is recreated during intel_uc_init_hw. We can't reuse the
intel_uc_suspend functionality as reset path already holds struct_mutex.

v2: Rebase w.r.t removal of GuC code restructuring. Updated reset_prepare
function as struct_mutex is not needed.

v3: Fixed typo in commit message. Made return from intel_uc_reset_prepare
simpler. (Michal)
Rebase w.r.t i915_modparams change.

v4: Rebase. Removed enable_guc_submission check for disabling GuC
submission. (Chris)

v5: Rebase.

v6: Not returning status from intel_uc_reset_prepare as we don't want to
abort further reset.

v7: Rebase.

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: MichaƂ Winiarski <michal.winiarski at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 drivers/gpu/drm/i915/intel_uc.c | 7 +++++++
 drivers/gpu/drm/i915/intel_uc.h | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3467248..e244fb7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2861,6 +2861,8 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv)
+	intel_uc_reset_prepare(dev_priv);
 	return err;
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 1c68072..cf2ec6a 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -378,3 +378,10 @@ void intel_uc_resume(struct drm_i915_private *dev_priv)
+void intel_uc_reset_prepare(struct drm_i915_private *dev_priv)
+	i915_guc_submission_disable(dev_priv);
+	intel_uc_runtime_suspend(dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 8352dc0..cd15f07 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -40,5 +40,6 @@ void intel_uc_sanitize(struct drm_i915_private *dev_priv,
 void intel_uc_runtime_resume(struct drm_i915_private *dev_priv);
 void intel_uc_suspend(struct drm_i915_private *dev_priv);
 void intel_uc_resume(struct drm_i915_private *dev_priv);
+void intel_uc_reset_prepare(struct drm_i915_private *dev_priv);

More information about the Intel-gfx-trybot mailing list