public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, paulo.r.zanoni@intel.com
Subject: Re: [PATCH v2 2/2] drm/i915: sanitize RPS resetting during GPU reset
Date: Thu, 04 Dec 2014 16:07:33 +0200	[thread overview]
Message-ID: <1417702053.25513.5.camel@intelbox> (raw)
In-Reply-To: <20141204135806.GF20350@phenom.ffwll.local>

On Thu, 2014-12-04 at 14:58 +0100, Daniel Vetter wrote:
> On Thu, Dec 04, 2014 at 02:59:32PM +0200, Imre Deak wrote:
> > Atm, we don't disable RPS interrupts and related work items before
> > resetting the GPU. This may interfere with the following GPU
> > initialization and cause RPS interrupts to show up in PM_IIR too early
> > before calling gen6_enable_rps_interrupts() (triggering a WARN there).
> > 
> > Solve this by disabling RPS interrupts and flushing any related work
> > items before resetting the GPU.
> > 
> > v2:
> > - split out the common parts of the gt suspend and the new gt reset
> >   functions (Paulo)
> > 
> > Reported-by: He, Shuang <shuang.he@intel.com>
> > Testcase: igt/gem_reset_stats/ban-render
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86644
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c |  5 ++++-
> >  drivers/gpu/drm/i915/intel_pm.c | 28 +++++++++++++++++++---------
> >  2 files changed, 23 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 71be3c9..8377249 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -810,6 +810,9 @@ int i915_reset(struct drm_device *dev)
> >  	if (!i915.reset)
> >  		return 0;
> >  
> > +	if (drm_core_check_feature(dev, DRIVER_MODESET))
> > +		intel_reset_gt_powersave(dev);
> 
> UMS support is dead, so you can leave this hunk out.

Ok, we can call here intel_reset_gt_powersave() unconditionally.

> -Daniel
> 
> > +
> >  	mutex_lock(&dev->struct_mutex);
> >  
> >  	i915_gem_reset(dev);
> > @@ -881,7 +884,7 @@ int i915_reset(struct drm_device *dev)
> >  		 * of re-init after reset.
> >  		 */
> >  		if (INTEL_INFO(dev)->gen > 5)
> > -			intel_reset_gt_powersave(dev);
> > +			intel_enable_gt_powersave(dev);
> >  	} else {
> >  		mutex_unlock(&dev->struct_mutex);
> >  	}
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 78911e2..45c786f 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -6072,6 +6072,20 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
> >  		valleyview_cleanup_gt_powersave(dev);
> >  }
> >  
> > +static void gen6_suspend_rps(struct drm_device *dev)
> > +{
> > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > +
> > +	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> > +
> > +	/*
> > +	 * TODO: disable RPS interrupts on GEN9+ too once RPS support
> > +	 * is added for it.
> > +	 */
> > +	if (INTEL_INFO(dev)->gen < 9)
> > +		gen6_disable_rps_interrupts(dev);
> > +}
> > +
> >  /**
> >   * intel_suspend_gt_powersave - suspend PM work and helper threads
> >   * @dev: drm device
> > @@ -6087,14 +6101,7 @@ void intel_suspend_gt_powersave(struct drm_device *dev)
> >  	if (INTEL_INFO(dev)->gen < 6)
> >  		return;
> >  
> > -	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> > -
> > -	/*
> > -	 * TODO: disable RPS interrupts on GEN9+ too once RPS support
> > -	 * is added for it.
> > -	 */
> > -	if (INTEL_INFO(dev)->gen < 9)
> > -		gen6_disable_rps_interrupts(dev);
> > +	gen6_suspend_rps(dev);
> >  
> >  	/* Force GPU to min freq during suspend */
> >  	gen6_rps_idle(dev_priv);
> > @@ -6197,8 +6204,11 @@ void intel_reset_gt_powersave(struct drm_device *dev)
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> > +	if (INTEL_INFO(dev)->gen < 6)
> > +		return;
> > +
> > +	gen6_suspend_rps(dev);
> >  	dev_priv->rps.enabled = false;
> > -	intel_enable_gt_powersave(dev);
> >  }
> >  
> >  static void ibx_init_clock_gating(struct drm_device *dev)
> > -- 
> > 1.8.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 


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

  reply	other threads:[~2014-12-04 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 12:59 [PATCH v2 0/2] drm/i915: sanitize RPS resetting during GPU reset Imre Deak
2014-12-04 12:59 ` [PATCH v2 1/2] drm/i915: move RPS PM_IER enabling to gen6_enable_rps_interrupts Imre Deak
2014-12-04 12:59 ` [PATCH v2 2/2] drm/i915: sanitize RPS resetting during GPU reset Imre Deak
2014-12-04 13:58   ` Daniel Vetter
2014-12-04 14:07     ` Imre Deak [this message]
2014-12-12 15:37       ` Paulo Zanoni
2014-12-15 15:14       ` Jani Nikula
2014-12-04 19:27   ` shuang.he

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=1417702053.25513.5.camel@intelbox \
    --to=imre.deak@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@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