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 v12 09/11] drm/i915/guc: Update GuC functionality in intel_uc_suspend/intel_uc_resume
Date: Thu, 28 Sep 2017 12:18:47 +0530	[thread overview]
Message-ID: <1506581329-29720-10-git-send-email-sagar.a.kamble@intel.com> (raw)
In-Reply-To: <1506581329-29720-1-git-send-email-sagar.a.kamble@intel.com>

With this patch we disable GuC submission in i915_drm_suspend path.
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. We have added resume functionality but currently it will
not be triggered as GuC is reset at the end of suspend. So we depend
on intel_uc_resume post intel_uc_init_hw in i915_drm_resume.
This also fixes issue where intel_uc_fini_hw was being called after
GPU reset happening in i915_gem_suspend during i915_driver_unload.

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

v3: Rebase w.r.t updated GuC suspend function name.

v4: Added lockdep assert in i915_guc_submission_enable/disable.
Refined intel_uc_suspend to remove unnecessary locals and simplify
return. (Michal Winiarski)
Removed comment in guc_client_free about ignoring failure for
destroy_doorbell. (Oscar)
Rebase w.r.t i915_modparams change.

v5: Removed lockdep assert as mutex is needed by internal functions
which already have the asserts. (Chris)
Removed enable_guc_submission check for disabling GuC submission. (Chris)

v6: Rebase with enable_guc_submission related change done in earlier
newly introduced patches.

v7: Fixed intel_uc_resume to call intel_uc_runtime_resume and added
comment about need to enable submission later if needed. Commit message
updated. (Sagar)

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

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index ca6c4f9..ab1c382 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -885,9 +885,6 @@ static void guc_client_free(struct i915_guc_client *client)
 	 * Be sure to drop any locks
 	 */
 
-	/* FIXME: in many cases, by the time we get here the GuC has been
-	 * reset, so we cannot destroy the doorbell properly. Ignore the
-	 * error message for now */
 	destroy_doorbell(client);
 	guc_stage_desc_fini(client->guc, client);
 	i915_gem_object_unpin_map(client->vma->obj);
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index c54b302..feb149e 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -471,8 +471,6 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
 {
 	guc_free_load_err_log(&dev_priv->guc);
 
-	i915_guc_submission_disable(dev_priv);
-
 	guc_disable_communication(&dev_priv->guc);
 
 	gen9_disable_guc_interrupts(dev_priv);
@@ -550,12 +548,24 @@ int intel_uc_runtime_resume(struct drm_i915_private *dev_priv)
 
 int intel_uc_suspend(struct drm_i915_private *dev_priv)
 {
-	return intel_guc_suspend(dev_priv);
+	mutex_lock(&dev_priv->drm.struct_mutex);
+	i915_guc_submission_disable(dev_priv);
+	mutex_unlock(&dev_priv->drm.struct_mutex);
+
+	return intel_uc_runtime_suspend(dev_priv);
 }
 
 int intel_uc_resume(struct drm_i915_private *dev_priv)
 {
-	return intel_guc_resume(dev_priv);
+	/*
+	 * FIXME: intel_uc_suspend disables GuC submission. This is
+	 * needed for unload path as well. Also, GuC is reset at the end
+	 * of suspend which makes disabling submission post that not
+	 * possible. Hence we re-enable submission during intel_uc_init_hw.
+	 * Once reset at the end of suspend is removed we need to enable
+	 * GuC submission post resuming GuC.
+	 */
+	return intel_uc_runtime_resume(dev_priv);
 }
 
 void intel_uc_sanitize(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-28  6:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28  6:48 [PATCH v12 00/11] GEM/GuC Suspend/Resume/Reset fixes and restructuring Sagar Arun Kamble
2017-09-28  6:48 ` [PATCH v12 01/11] drm/i915: Create GEM runtime resume helper and handle GEM suspend/resume errors Sagar Arun Kamble
2017-09-29 11:43   ` Joonas Lahtinen
2017-09-29 11:49     ` Chris Wilson
2017-09-29 13:16       ` Joonas Lahtinen
2017-09-29 13:51         ` Sagar Arun Kamble
2017-09-28  6:48 ` [PATCH v12 02/11] drm/i915: Update GEM suspend/resume flows with GuC suspend/resume functions Sagar Arun Kamble
2017-09-29 11:45   ` Joonas Lahtinen
2017-09-29 13:52     ` Sagar Arun Kamble
2017-09-28  6:48 ` [PATCH v12 03/11] drm/i915: Move i915_gem_restore_fences to i915_gem_resume Sagar Arun Kamble
2017-09-29 11:48   ` Joonas Lahtinen
2017-09-29 13:59     ` Sagar Arun Kamble
2017-09-29 14:01       ` Sagar Arun Kamble
2017-10-02  8:33       ` Joonas Lahtinen
2017-09-28  6:48 ` [PATCH v12 04/11] drm/i915: Create uC runtime and system suspend/resume helpers Sagar Arun Kamble
2017-09-29 12:12   ` Joonas Lahtinen
2017-09-29 14:13     ` Sagar Arun Kamble
2017-09-29 14:39       ` Michal Wajdeczko
2017-09-28  6:48 ` [PATCH v12 05/11] drm/i915/guc: Introduce intel_uc_sanitize Sagar Arun Kamble
2017-09-29 12:00   ` Joonas Lahtinen
2017-09-29 14:22     ` Sagar Arun Kamble
2017-10-02  8:37       ` Joonas Lahtinen
2017-09-28  6:48 ` [PATCH v12 06/11] drm/i915/guc: Make GuC related disable/destroy functions not depend on i915.enable_guc_submission Sagar Arun Kamble
2017-09-29 12:27   ` Joonas Lahtinen
2017-09-30  8:22     ` Sagar Arun Kamble
2017-10-02  8:51       ` Joonas Lahtinen
2017-09-28  6:48 ` [PATCH v12 07/11] drm/i915/guc: Update i915.enable_guc_loading check in intel_uc_fini_hw Sagar Arun Kamble
2017-09-29 12:29   ` Joonas Lahtinen
2017-09-28  6:48 ` [PATCH v12 08/11] drm/i915/guc: Update GuC ggtt.invalidate/interrupts/communication across RPM suspend/resume Sagar Arun Kamble
2017-09-28  6:48 ` Sagar Arun Kamble [this message]
2017-09-28  6:48 ` [PATCH v12 10/11] drm/i915/guc: Disable GuC submission and suspend it prior to i915 reset Sagar Arun Kamble
2017-09-28  6:48 ` [PATCH v12 11/11] drm/i915/guc: Fix GuC cleanup in unload path Sagar Arun Kamble
2017-09-28  7:11 ` ✗ Fi.CI.BAT: warning for GEM/GuC Suspend/Resume/Reset fixes and restructuring (rev5) Patchwork
2017-09-28  7:38   ` Sagar Arun Kamble

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=1506581329-29720-10-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.