All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Sagar Arun Kamble <sagar.a.kamble@intel.com>
Subject: Re: [PATCH v13 19/21] drm/i915/guc: Fix enable/disable of GuC GGTT invalidate functions
Date: Thu, 12 Oct 2017 12:08:50 +0300	[thread overview]
Message-ID: <1507799330.5138.29.camel@linux.intel.com> (raw)
In-Reply-To: <op.y7yikdsixaggs7@mwajdecz-mobl1.ger.corp.intel.com>

On Wed, 2017-10-11 at 20:20 +0200, Michal Wajdeczko wrote:
> On Wed, 11 Oct 2017 20:09:10 +0200, Sagar Arun Kamble  
> <sagar.a.kamble@intel.com> wrote:
> 
> > 
> > 
> > On 10/11/2017 11:28 PM, Michal Wajdeczko wrote:
> > > On Wed, 11 Oct 2017 19:44:31 +0200, Sagar Arun Kamble  
> > > <sagar.a.kamble@intel.com> wrote:
> > > 
> > > > 
> > > > 
> > > > On 10/11/2017 11:05 PM, Michal Wajdeczko wrote:
> > > > > On Wed, 11 Oct 2017 10:54:14 +0200, Sagar Arun Kamble  
> > > > > <sagar.a.kamble@intel.com> wrote:
> > > > > 
> > > > > > i915_ggtt_enable_guc has to happen first during i915_gem_resume
> > > > > > if GuC loading is enabled before GTT restore. In case GuC is not
> > > > > > loaded this enabling happening during intel_uc_init_hw need to
> > > > > > skipped. (avoid the GEM_BUG_ON)
> > > > > > i915_ggtt_disable_guc at the end of reset/suspend/unload is needed
> > > > > > post GGTT suspend operations. Calling it during uc_sanitize covers
> > > > > > all scenarios. Hence, it is removed from intel_uc_fini_hw. Also these
> > > > > > needto be protected by struct_mutex. Hence struct_mutex locking is
> > > > > > added in i915_gem_sanitize while sanitizing uC. struct_mutex is  
> > > > > > already
> > > > > > held during i915_gem_reset_prepare.
> > > > > > 
> > > > > > 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>
> > > > > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > > > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > > > > ---
> > > > > >  drivers/gpu/drm/i915/i915_gem.c |  4 ++++
> > > > > >  drivers/gpu/drm/i915/intel_uc.c | 16 +++++++++++-----
> > > > > >  2 files changed, 15 insertions(+), 5 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/gpu/drm/i915/i915_gem.c  
> > > > > > b/drivers/gpu/drm/i915/i915_gem.c
> > > > > > index a4bbf6c..77a0746 100644
> > > > > > --- a/drivers/gpu/drm/i915/i915_gem.c
> > > > > > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > > > > > @@ -4759,6 +4759,10 @@ void i915_gem_resume(struct drm_i915_private  
> > > > > > *dev_priv)
> > > > > >      WARN_ON(dev_priv->gt.awake);
> > > > > >     mutex_lock(&dev->struct_mutex);
> > > > > > +    /* We need to notify the guc whenever we change the GGTT */
> > > > > > +    if (i915_modparams.enable_guc_loading)
> > > > > > +        i915_ggtt_enable_guc(dev_priv);
> > > > > > +
> > > > > >      i915_gem_restore_gtt_mappings(dev_priv);
> > > > > >      i915_gem_restore_fences(dev_priv);
> > > > > > diff --git a/drivers/gpu/drm/i915/intel_uc.c  
> > > > > > b/drivers/gpu/drm/i915/intel_uc.c
> > > > > > index 9010ab5..0b799fe 100644
> > > > > > --- a/drivers/gpu/drm/i915/intel_uc.c
> > > > > > +++ b/drivers/gpu/drm/i915/intel_uc.c
> > > > > > @@ -184,8 +184,14 @@ int intel_uc_init_hw(struct drm_i915_private  
> > > > > > *dev_priv)
> > > > > >      guc_disable_communication(guc);
> > > > > >      gen9_reset_guc_interrupts(dev_priv);
> > > > > > -    /* We need to notify the guc whenever we change the GGTT */
> > > > > > -    i915_ggtt_enable_guc(dev_priv);
> > > > > > +    /*
> > > > > > +     * We need to notify the guc whenever we change the GGTT.
> > > > > > +     * During resume from sleep we would have already updated the
> > > > > > +     * GGTT invalidate function for GuC during i915_gem_resume so
> > > > > > +     * we need to skip here. Will enable here on driver load/reset.
> > > > > > +     */
> > > > > > +    if (!guc->suspended)
> > > > > > +        i915_ggtt_enable_guc(dev_priv);
> > > > > >     if (i915_modparams.enable_guc_submission) {
> > > > > >          /*
> > > > > > @@ -309,9 +315,6 @@ void intel_uc_cleanup(struct drm_i915_private  
> > > > > > *dev_priv)
> > > > > >      guc_free_load_err_log(guc);
> > > > > >     i915_guc_submission_cleanup(dev_priv);
> > > > > > -
> > > > > > -    if (i915_modparams.enable_guc_loading)
> > > > > > -        i915_ggtt_disable_guc(dev_priv);
> > > > > >  }
> > > > > > /**
> > > > > > @@ -452,6 +455,9 @@ void intel_uc_sanitize(struct drm_i915_private  
> > > > > > *dev_priv)
> > > > > >      struct intel_uc_fw *huc_fw = &dev_priv->huc.fw;
> > > > > >     if (i915_modparams.enable_guc_loading) {
> > > > > > +        if (guc_fw->load_status == INTEL_UC_FIRMWARE_SUCCESS)
> > > > > 
> > > > > Hmm, isn't that check redundant ?
> > > > 
> > > > uc_sanitize can happen without firmware loaded too in which case we
> > > 
> > > If uc_sanitize can be loaded without firmware loaded, then I assume
> > > i915_modparams.enable_guc_loading will be cleared too, right ?
> > > 
> > > I'm just wondering if we need to check both modparam and fw status.
> > 
> > actually load time uc_sanitize is happening before uc_sanitize_options
> 
> Hmm, so maybe we should call intel_sanitize_options() from or right after
> i915_driver_init_early() ? It looks that all 'sanitize-options' are using
> only device info flags, there is no MMIO access. Chris/Joonas?

Will be hard to answer any question on patch 19/21, when the preceding
patches are still under debate.

What I meant with focusing on single series at a time is that we first
discuss on any changes to get the first patches merged in reasonable
sized chunks of few patches per merge. During that discussion, lets
hold the dependent series from the mailing list for a while, because
the existing patches will cause changes and invalidate the reviews.

Now I have multiple dozens of e-mails in my inbox, and we're not going
to make progress that way. My understanding is that Michal's patches on
better organizing the GuC code are the first ones, so lets focus on
those first. So lets get back to this series after we're done with the
code organization sanitization.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-12  9:08 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
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 [this message]
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=1507799330.5138.29.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=sagar.a.kamble@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 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.