Re: [PATCH v4 5/9] drm/i915/guc: Disable GuC submission and suspend it prior to i915 reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 20 Sep 2017 19:38:20 +0200, Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx> wrote:

Before i915 reset we need to disable GuC submission and suspend GuC
operarions 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.

Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
Cc: Michał Winiarski <michal.winiarski@xxxxxxxxx>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem.c |  2 ++
 drivers/gpu/drm/i915/intel_uc.c | 14 ++++++++++++++
 drivers/gpu/drm/i915/intel_uc.h |  1 +
 3 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index dd56d45..76e1bb2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2847,6 +2847,8 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv)
	i915_gem_revoke_fences(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 0c7e45c7..aac8526 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -671,3 +671,17 @@ int intel_uc_resume(struct drm_i915_private *dev_priv)
 {
 	return 0;
 }
+
+int intel_uc_reset_prepare(struct drm_i915_private *dev_priv)
+{
+	int ret;
+
+	if (i915.enable_guc_submission)
+		i915_guc_submission_disable(dev_priv);
+
+	ret = intel_uc_runtime_suspend(dev_priv);
+	if (ret)
+		return ret;
+
+	return 0;

Make it trivial:

	return intel_uc_runtime_suspend(dev_priv);

With above fixed, you can add my r-b

Michal

+}
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 5f49d13..069c2b2 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -212,6 +212,7 @@ struct intel_huc {
 int intel_uc_runtime_resume(struct drm_i915_private *dev_priv);
 int intel_uc_suspend(struct drm_i915_private *dev_priv);
 int intel_uc_resume(struct drm_i915_private *dev_priv);
+int intel_uc_reset_prepare(struct drm_i915_private *dev_priv);
 int intel_guc_sample_forcewake(struct intel_guc *guc);
int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len); int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux