All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v4 4/9] drm/i915/guc: Update suspend functionality in intel_uc_suspend path
Date: Wed, 20 Sep 2017 23:08:19 +0530	[thread overview]
Message-ID: <1505929104-28823-5-git-send-email-sagar.a.kamble@intel.com> (raw)
In-Reply-To: <1505929104-28823-1-git-send-email-sagar.a.kamble@intel.com>

With this patch we disable GuC submission in i915_drm_suspend. This will
destroy the client which will be setup back again. We also reuse the
complete sanitization done via intel_uc_runtime_suspend in this path.
Post drm resume this state is recreated by intel_uc_init_hw hence we need
not have similar reuse for intel_uc_resume.
This also fixes issue where intel_uc_fini_hw was being called after GPU
reset happening in i915_gem_suspend in i915_driver_unload.

v2: Rebase w.r.t removal of GuC code restructuring. Added struct_mutex
protection for i915_guc_submission_disable.

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index fa698db..0c7e45c7 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -446,9 +446,6 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
 	if (!i915.enable_guc_loading)
 		return;
 
-	if (i915.enable_guc_submission)
-		i915_guc_submission_disable(dev_priv);
-
 	guc_disable_communication(&dev_priv->guc);
 
 	if (i915.enable_guc_submission) {
@@ -654,7 +651,20 @@ int intel_uc_runtime_resume(struct drm_i915_private *dev_priv)
 
 int intel_uc_suspend(struct drm_i915_private *dev_priv)
 {
-	return intel_guc_enter_sleep(&dev_priv->guc);
+	struct drm_device *dev = &dev_priv->drm;
+	int ret;
+
+	if (i915.enable_guc_submission) {
+		mutex_lock(&dev->struct_mutex);
+		i915_guc_submission_disable(dev_priv);
+		mutex_unlock(&dev->struct_mutex);
+	}
+
+	ret = intel_uc_runtime_suspend(dev_priv);
+	if (ret)
+		return ret;
+
+	return 0;
 }
 
 int intel_uc_resume(struct drm_i915_private *dev_priv)
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-09-20 17:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 17:38 [PATCH v4 0/9] GuC Fixes, Minor restructuring changes and v9+ logging change Sagar Arun Kamble
2017-09-20 17:38 ` [PATCH v4 1/9] drm/i915: Create uc runtime and system suspend/resume helpers Sagar Arun Kamble
2017-09-21 17:16   ` Michał Winiarski
2017-09-21 17:26     ` Sagar Arun Kamble
2017-09-20 17:38 ` [PATCH v4 2/9] drm/i915/guc: Update prototype/name of GuC suspend/resume fns and move to intel_uc.c Sagar Arun Kamble
2017-09-20 21:25   ` Michal Wajdeczko
2017-09-21 16:40     ` Sagar Arun Kamble
2017-09-20 17:38 ` [PATCH v4 3/9] drm/i915/guc: Update GuC ggtt.invalidate/interrupts/communication across RPM suspend/resume Sagar Arun Kamble
2017-09-20 21:33   ` Michal Wajdeczko
2017-09-21 16:43     ` Sagar Arun Kamble
2017-09-20 17:38 ` Sagar Arun Kamble [this message]
2017-09-21 16:46   ` [PATCH v4 4/9] drm/i915/guc: Update suspend functionality in intel_uc_suspend path Michał Winiarski
2017-09-21 16:55     ` Sagar Arun Kamble
2017-09-21 20:52       ` Michał Winiarski
2017-09-20 17:38 ` [PATCH v4 5/9] drm/i915/guc: Disable GuC submission and suspend it prior to i915 reset Sagar Arun Kamble
2017-09-20 21:45   ` Michal Wajdeczko
2017-09-20 17:38 ` [PATCH v4 6/9] drm/i915/guc: Fix GuC cleanup in unload path Sagar Arun Kamble
2017-09-20 21:53   ` Michal Wajdeczko
2017-09-20 17:38 ` [PATCH v4 7/9] drm/i915/guc: Remove i915_guc_log_unregister Sagar Arun Kamble
2017-09-20 20:58   ` Michal Wajdeczko
2017-09-21 17:31     ` Sagar Arun Kamble
2017-09-21 17:40       ` Sagar Arun Kamble
2017-09-21 20:39         ` Michal Wajdeczko
2017-09-22  4:22           ` Sagar Arun Kamble
2017-09-20 17:38 ` [PATCH v4 8/9] drm/i915/guc: Enable default/critical logging in GuC by default from GuC v9 Sagar Arun Kamble
2017-09-20 17:38 ` [PATCH v4 9/9] drm/i915: Reorganize HuC authentication Sagar Arun Kamble
2017-09-20 18:47 ` ✓ Fi.CI.BAT: success for GuC Fixes, Minor restructuring changes and v9+ logging change Patchwork
2017-09-20 20:55 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-09-21  3:11   ` Kamble, Sagar A

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=1505929104-28823-5-git-send-email-sagar.a.kamble@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.