All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
@ 2016-08-10 12:58 Chris Wilson
  2016-08-10 13:12 ` Ville Syrjälä
  2016-08-10 14:32 ` ✗ Ro.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2016-08-10 12:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

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>
---
 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

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
  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ä
  2016-08-10 14:32 ` ✗ Ro.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2016-08-10 13:12 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx, Mika Kuoppala

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* ✗ Ro.CI.BAT: failure for drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
  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ä
@ 2016-08-10 14:32 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-08-10 14:32 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
URL   : https://patchwork.freedesktop.org/series/10909/
State : failure

== Summary ==

Series 10909v1 drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init
http://patchwork.freedesktop.org/api/1.0/series/10909/revisions/1/mbox

Test kms_cursor_legacy:
        Subgroup basic-cursor-vs-flip-legacy:
                pass       -> FAIL       (ro-byt-n2820)
        Subgroup basic-flip-vs-cursor-legacy:
                fail       -> PASS       (ro-skl3-i5-6260u)
                fail       -> PASS       (ro-bdw-i5-5250u)
        Subgroup basic-flip-vs-cursor-varying-size:
                fail       -> PASS       (ro-hsw-i7-4770r)
                fail       -> PASS       (ro-byt-n2820)
                fail       -> PASS       (ro-bdw-i5-5250u)
                pass       -> DMESG-FAIL (fi-skl-i7-6700k)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (ro-bdw-i7-5600u)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> SKIP       (ro-bdw-i5-5250u)
        Subgroup suspend-read-crc-pipe-c:
                skip       -> DMESG-WARN (ro-bdw-i5-5250u)

fi-kbl-qkkr      total:244  pass:185  dwarn:30  dfail:0   fail:2   skip:27 
fi-skl-i5-6260u  total:244  pass:224  dwarn:4   dfail:0   fail:2   skip:14 
fi-skl-i7-6700k  total:244  pass:208  dwarn:4   dfail:2   fail:2   skip:28 
fi-snb-i7-2600   total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
ro-bdw-i5-5250u  total:240  pass:220  dwarn:3   dfail:0   fail:0   skip:17 
ro-bdw-i7-5557U  total:240  pass:220  dwarn:1   dfail:0   fail:0   skip:19 
ro-bdw-i7-5600u  total:240  pass:207  dwarn:0   dfail:0   fail:1   skip:32 
ro-byt-n2820     total:240  pass:196  dwarn:0   dfail:0   fail:4   skip:40 
ro-hsw-i3-4010u  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-hsw-i7-4770r  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-ilk1-i5-650   total:235  pass:173  dwarn:0   dfail:0   fail:2   skip:60 
ro-ivb-i7-3770   total:240  pass:205  dwarn:0   dfail:0   fail:0   skip:35 
ro-ivb2-i7-3770  total:240  pass:209  dwarn:0   dfail:0   fail:0   skip:31 
ro-skl3-i5-6260u total:240  pass:223  dwarn:0   dfail:0   fail:3   skip:14 
ro-bsw-n3050 failed to connect after reboot

Results at /archive/results/CI_IGT_test/RO_Patchwork_1818/

8e34143 drm-intel-nightly: 2016y-08m-10d-13h-03m-18s UTC integration manifest
8a80956 drm/i915: Fix nesting of rps.mutex and struct_mutex during powersave init

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-10 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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ä
2016-08-10 14:32 ` ✗ Ro.CI.BAT: failure for " Patchwork

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.