public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH] drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
Date: Wed, 10 Aug 2016 16:12:30 +0300	[thread overview]
Message-ID: <20160810131230.GQ4329@intel.com> (raw)
In-Reply-To: <1470833904-29886-1-git-send-email-chris@chris-wilson.co.uk>

On Wed, Aug 10, 2016 at 01:58:24PM +0100, Chris Wilson wrote:
> During intel_gt_powersave_init() we take the RPS mutex to ensure that
> all locking requirements are met as we talk to the punit, but we also
> require the struct_mutex for allocating a slice of the global GTT for a
> power context on Valleyview. struct_mutex must be the outer lock here,
> as we nest rps.mutex inside later on.
> 
> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Fixes: 773ea9a80132 ("drm/i915: Perform static RPS frequency setup before...")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 1035eb5e52dd..20794804f3bb 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5675,8 +5675,6 @@ static void valleyview_setup_pctx(struct drm_i915_private *dev_priv)
>  	u32 pcbr;
>  	int pctx_size = 24*1024;
>  
> -	mutex_lock(&dev_priv->drm.struct_mutex);
> -
>  	pcbr = I915_READ(VLV_PCBR);
>  	if (pcbr) {
>  		/* BIOS set it up already, grab the pre-alloc'd space */
> @@ -5712,7 +5710,6 @@ static void valleyview_setup_pctx(struct drm_i915_private *dev_priv)
>  out:
>  	DRM_DEBUG_DRIVER("PCBR: 0x%08x\n", I915_READ(VLV_PCBR));
>  	dev_priv->vlv_pctx = pctx;
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
>  }
>  
>  static void valleyview_cleanup_pctx(struct drm_i915_private *dev_priv)
> @@ -6488,6 +6485,7 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)
>  		intel_runtime_pm_get(dev_priv);
>  	}
>  
> +	mutex_lock(&dev_priv->drm.struct_mutex);
>  	mutex_lock(&dev_priv->rps.hw_lock);
>  
>  	/* Initialize RPS limits (for userspace) */
> @@ -6529,6 +6527,7 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)
>  	dev_priv->rps.boost_freq = dev_priv->rps.max_freq;
>  
>  	mutex_unlock(&dev_priv->rps.hw_lock);
> +	mutex_unlock(&dev_priv->drm.struct_mutex);
>  
>  	intel_autoenable_gt_powersave(dev_priv);
>  }
> -- 
> 2.8.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-10 13:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 12:58 [PATCH] drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init Chris Wilson
2016-08-10 13:12 ` Ville Syrjälä [this message]
2016-08-10 14:32 ` ✗ Ro.CI.BAT: failure for " 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=20160810131230.GQ4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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