public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v13 09/21] drm/i915/uc: Create uC suspend and resume functions
Date: Thu, 12 Oct 2017 11:55:17 +0530	[thread overview]
Message-ID: <5ec72742-9458-eb7c-d8cf-b62fbd89c83d@intel.com> (raw)
In-Reply-To: <op.y7ybxapfxaggs7@mwajdecz-mobl1.ger.corp.intel.com>



On 10/11/2017 9:27 PM, Michal Wajdeczko wrote:
> On Wed, 11 Oct 2017 10:54:04 +0200, Sagar Arun Kamble 
> <sagar.a.kamble@intel.com> wrote:
>
>> Prepared generic helpers intel_uc_suspend, intel_uc_resume. These are
>> called from respective GEM functions. Only exception is intel_uc_resume
>> that needs to be called w/ or w/o GuC loaded in i915_drm_resume path.
>> Changes to add WOPCM condition check to load GuC during resume will be
>> added in later patches.
>>
>> v2: Rebase w.r.t removal of GuC code restructuring.
>>
>> v3: Calling intel_uc_resume from i915_gem_resume post resuming
>> i915 gem setup. This is symmetrical with i915_gem_suspend.
>> Removed error messages from i915 suspend/resume routines as
>> uC suspend/resume routines will have those. (Michal Wajdeczko)
>> Declare wedged on uc_suspend failure and uc_resume failure.
>> (Michał Winiarski)
>> Keeping the uC suspend/resume function definitions close to other
>> uC functions.
>>
>> v4: Added implementation to intel_uc_resume as GuC resume is
>> needed to be triggered post reloading the firmware as well. Added
>> comments about semantics of GuC resume with the firmware reload.
>>
>> v5: Updated return from i915_gem_runtime_suspend. Moved the comment
>> about GuC reload optimization to intel_uc_init_hw. (Michal Wajdeczko)
>> Updated comments as FIXME.
>>
>> v6: Kept error handling for failure from i915_gem_runtime_suspend only.
>> We don't want GEM/GuC resume failure to impact intel_runtime_resume or
>> i915_drm_resume. GEM suspend failure along i915_drm_suspend can also
>> be ignored as we reset GPU post that. Updated comments. (Chris, Joonas)
>>
>> v7: Removed intel_uc_resume from i915_drm_resume as it will be done as
>> part of intel_uc_init_hw in further patches. Removed TODO comments about
>> handling GuC load skip on resume. This is to be addressed in further
>> patches. Added error return from intel_uc_suspend as we plan to add
>> functionality to resume submission in case of suspend failure in further
>> patches. Removed runtime uC suspend/resume functions as functionality
>> will be similar in both paths.
>>
>> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Michał Winiarski <michal.winiarski@intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_gem.c | 17 +++++++++++------
>>  drivers/gpu/drm/i915/intel_uc.c | 16 ++++++++++++++++
>>  drivers/gpu/drm/i915/intel_uc.h |  2 ++
>>  3 files changed, 29 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem.c 
>> b/drivers/gpu/drm/i915/i915_gem.c
>> index 38447ae..7d1b7e1 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.c
>> +++ b/drivers/gpu/drm/i915/i915_gem.c
>> @@ -2056,11 +2056,13 @@ static void 
>> __i915_gem_object_release_mmap(struct drm_i915_gem_object *obj)
>>  int i915_gem_runtime_suspend(struct drm_i915_private *dev_priv)
>>  {
>>      struct drm_i915_gem_object *obj, *on;
>> -    int i;
>> +    int i, ret;
>>     mutex_lock(&dev_priv->drm.struct_mutex);
>> -    intel_guc_suspend(&dev_priv->guc);
>> +    ret = intel_uc_suspend(dev_priv);
>> +    if (ret)
>> +        goto out_unlock;
>>     /*
>>       * Only called during RPM suspend. All users of the userfault_list
>> @@ -2098,9 +2100,10 @@ int i915_gem_runtime_suspend(struct 
>> drm_i915_private *dev_priv)
>>          reg->dirty = true;
>>      }
>> +out_unlock:
>>      mutex_unlock(&dev_priv->drm.struct_mutex);
>> -    return 0;
>> +    return ret;
>>  }
>> void i915_gem_runtime_resume(struct drm_i915_private *dev_priv)
>> @@ -2110,7 +2113,7 @@ void i915_gem_runtime_resume(struct 
>> drm_i915_private *dev_priv)
>>      i915_gem_init_swizzling(dev_priv);
>>      i915_gem_restore_fences(dev_priv);
>> -    intel_guc_resume(&dev_priv->guc);
>> +    intel_uc_resume(dev_priv);
>>     mutex_unlock(&dev_priv->drm.struct_mutex);
>>  }
>> @@ -4681,7 +4684,9 @@ int i915_gem_suspend(struct drm_i915_private 
>> *dev_priv)
>>          i915_gem_set_wedged(dev_priv); /* no hope, discard 
>> everything */
>>     mutex_lock(&dev->struct_mutex);
>> -    intel_guc_suspend(&dev_priv->guc);
>> +    ret = intel_uc_suspend(dev_priv);
>> +    if (ret)
>> +        goto err_unlock;
>>      mutex_unlock(&dev->struct_mutex);
>>     /*
>> @@ -4730,7 +4735,7 @@ void i915_gem_resume(struct drm_i915_private 
>> *dev_priv)
>>       */
>>      dev_priv->gt.resume(dev_priv);
>> -    intel_guc_resume(&dev_priv->guc);
>> +    intel_uc_resume(dev_priv);
>>     mutex_unlock(&dev->struct_mutex);
>>  }
>> diff --git a/drivers/gpu/drm/i915/intel_uc.c 
>> b/drivers/gpu/drm/i915/intel_uc.c
>> index 7305486..b5c132c 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.c
>> +++ b/drivers/gpu/drm/i915/intel_uc.c
>> @@ -283,3 +283,19 @@ void intel_uc_fini_hw(struct drm_i915_private 
>> *dev_priv)
>>      if (i915_modparams.enable_guc_loading)
>>          i915_ggtt_disable_guc(dev_priv);
>>  }
>> +
>> +int intel_uc_suspend(struct drm_i915_private *dev_priv)
>> +{
>> +    int ret;
>> +
>> +    ret = intel_guc_suspend(&dev_priv->guc);
>> +    if (ret)
>> +        DRM_ERROR("Failed to suspend GuC\n");
>> +
>> +    return ret;
>> +}
>> +
>> +void intel_uc_resume(struct drm_i915_private *dev_priv)
>> +{
>> +    intel_guc_resume(&dev_priv->guc);
>> +}
>
> Can we add kerneldoc for above new functions?
> With doc added
Since full flow was established in the later patches hence deferred doc 
addition.
Will add partially here. Thanks.
>
> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>
>> diff --git a/drivers/gpu/drm/i915/intel_uc.h 
>> b/drivers/gpu/drm/i915/intel_uc.h
>> index e18d3bb..e20bc72 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.h
>> +++ b/drivers/gpu/drm/i915/intel_uc.h
>> @@ -34,5 +34,7 @@
>>  void intel_uc_fini_fw(struct drm_i915_private *dev_priv);
>>  int intel_uc_init_hw(struct drm_i915_private *dev_priv);
>>  void intel_uc_fini_hw(struct drm_i915_private *dev_priv);
>> +int intel_uc_suspend(struct drm_i915_private *dev_priv);
>> +void intel_uc_resume(struct drm_i915_private *dev_priv);
>> #endif

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

  reply	other threads:[~2017-10-12  6:25 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  8:53 [PATCH v13 00/21] drm/i915: GEM/GuC Suspend/Resume/Reset fixes and restructuring Sagar Arun Kamble
2017-10-11  8:53 ` [PATCH v13 01/21] drm/i915/guc: Add GuC submission initialization/enable state variables Sagar Arun Kamble
2017-10-11  8:53 ` [PATCH v13 02/21] drm/i915/guc: Sanitize module parameter guc_log_level Sagar Arun Kamble
2017-10-11 14:51   ` Michal Wajdeczko
2017-10-12  5:48     ` Sagar Arun Kamble
2017-10-11  8:53 ` [PATCH v13 03/21] drm/i915/guc: Add status checks to enable/disable_guc_interrupts Sagar Arun Kamble
2017-10-11 15:20   ` Michal Wajdeczko
2017-10-12  5:50     ` Sagar Arun Kamble
2017-10-12  6:17       ` Sagar Arun Kamble
2017-10-13  8:09         ` Sagar Arun Kamble
2017-10-11  8:53 ` [PATCH v13 04/21] drm/i915/guc: Remove enable_guc_submission dependency for invoking GuC log functions Sagar Arun Kamble
2017-10-11 15:40   ` Michal Wajdeczko
2017-10-12  5:58     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 05/21] drm/i915/guc: Update enable_guc_loading check in intel_uc_fini_hw Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 06/21] drm/i915/guc: Pass intel_guc struct parameter to intel_guc_suspend/resume Sagar Arun Kamble
2017-10-11 15:50   ` Michal Wajdeczko
2017-10-12  6:18     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 07/21] drm/i915: Create GEM runtime resume helper and handle GEM runtime suspend error Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 08/21] drm/i915/guc: Update GEM suspend/resume flows with GuC suspend/resume functions Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 09/21] drm/i915/uc: Create uC suspend and resume functions Sagar Arun Kamble
2017-10-11 15:57   ` Michal Wajdeczko
2017-10-12  6:25     ` Sagar Arun Kamble [this message]
2017-10-11  8:54 ` [PATCH v13 10/21] drm/i915/guc: Update uC suspend/resume function separating Host/GuC tasks Sagar Arun Kamble
2017-10-11 16:19   ` Michal Wajdeczko
2017-10-12  6:38     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 11/21] drm/i915/guc: Remove GuC submission disable from i915_driver_unload Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 12/21] drm/i915/guc: Fix GuC related state cleanup in unload path Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 13/21] drm/i915/uc: Support resume from sleep w/ and w/o GuC/HuC reload Sagar Arun Kamble
2017-10-11 17:06   ` Michal Wajdeczko
2017-10-12  6:48     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 14/21] drm/i915/uc: Update GEM runtime resume with need for reload of GuC/HuC Sagar Arun Kamble
2017-10-11 17:19   ` Michal Wajdeczko
2017-10-12  6:50     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 15/21] drm/i915/guc: Add comment about update needed in GuC submission enable/disable for RPM Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 16/21] drm/i915: Enable interrupts prior to GEM resume during i915_drm_resume Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 17/21] drm/i915: Split i915_gem_suspend into gem quiescing and HW suspend Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 18/21] drm/i915/uc: Introduce intel_uc_sanitize to initialize GuC/HuC reset state Sagar Arun Kamble
2017-10-11 17:30   ` Michal Wajdeczko
2017-10-11 17:46     ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 19/21] drm/i915/guc: Fix enable/disable of GuC GGTT invalidate functions Sagar Arun Kamble
2017-10-11 17:35   ` Michal Wajdeczko
2017-10-11 17:44     ` Sagar Arun Kamble
2017-10-11 17:58       ` Michal Wajdeczko
2017-10-11 18:09         ` Sagar Arun Kamble
2017-10-11 18:20           ` Michal Wajdeczko
2017-10-12  9:08             ` Joonas Lahtinen
2017-10-12 12:08               ` Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 20/21] drm/i915/guc: Disable GuC submission/interrupts/communication in intel_uc_sanitize Sagar Arun Kamble
2017-10-11  8:54 ` [PATCH v13 21/21] HAX enable GuC submission for CI Sagar Arun Kamble
2017-10-11  9:44 ` ✗ Fi.CI.BAT: failure for drm/i915: GEM/GuC Suspend/Resume/Reset fixes and restructuring Patchwork

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=5ec72742-9458-eb7c-d8cf-b62fbd89c83d@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox