All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw()
@ 2017-11-22 22:25 Chris Wilson
  2017-11-22 22:53 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2017-11-22 22:25 UTC (permalink / raw)
  To: intel-gfx

Since commit 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics"),
vlv_residency_raw() may be called from an irq-disabled context (via perf
event sampling on remote cpu). As such, we can no longer assume that we
are called from process context and must save/restore the irq state for
the spinlock.

Fixes: 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics")
Testcase: igt/perf_pmu/other-init-3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_pm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7d41aad79166..03d67d8ab647 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -9396,12 +9396,13 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
 			     const i915_reg_t reg)
 {
 	u32 lower, upper, tmp;
+	unsigned long flags;
 	int loop = 2;
 
 	/* The register accessed do not need forcewake. We borrow
 	 * uncore lock to prevent concurrent access to range reg.
 	 */
-	spin_lock_irq(&dev_priv->uncore.lock);
+	spin_lock_irqsave(&dev_priv->uncore.lock, flags);
 
 	/* vlv and chv residency counters are 40 bits in width.
 	 * With a control bit, we can choose between upper or lower
@@ -9432,7 +9433,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
 	 * now.
 	 */
 
-	spin_unlock_irq(&dev_priv->uncore.lock);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
 
 	return lower | (u64)upper << 8;
 }
@@ -9451,7 +9452,6 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
 		mul = 1000000;
 		div = dev_priv->czclk_freq;
 		time_hw = vlv_residency_raw(dev_priv, reg);
-
 	} else {
 		/* 833.33ns units on Gen9LP, 1.28us elsewhere. */
 		if (IS_GEN9_LP(dev_priv)) {
-- 
2.15.0

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Save/restore irq state for vlv_residency_raw()
  2017-11-22 22:25 [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw() Chris Wilson
@ 2017-11-22 22:53 ` Patchwork
  2017-11-23  0:06 ` ✓ Fi.CI.IGT: " Patchwork
  2017-11-23  6:56 ` [PATCH] " Tvrtko Ursulin
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-11-22 22:53 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Save/restore irq state for vlv_residency_raw()
URL   : https://patchwork.freedesktop.org/series/34260/
State : success

== Summary ==

Series 34260v1 drm/i915: Save/restore irq state for vlv_residency_raw()
https://patchwork.freedesktop.org/api/1.0/series/34260/revisions/1/mbox/

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:444s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:462s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:378s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:542s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:276s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:505s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:514s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:497s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:496s
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:607s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:265s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:545s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:429s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:441s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:430s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:462s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:479s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:529s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:534s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:579s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:544s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:521s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:498s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:467s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:559s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:427s
Blacklisted hosts:
fi-cnl-y         total:286  pass:259  dwarn:0   dfail:0   fail:0   skip:26 
fi-glk-dsi       total:289  pass:162  dwarn:0   dfail:10  fail:2   skip:115 time:403s

a3f080ee939e8befca924f1ab83deeabfa7ff98e drm-tip: 2017y-11m-22d-18h-37m-24s UTC integration manifest
09cc96248c51 drm/i915: Save/restore irq state for vlv_residency_raw()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7244/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915: Save/restore irq state for vlv_residency_raw()
  2017-11-22 22:25 [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw() Chris Wilson
  2017-11-22 22:53 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-11-23  0:06 ` Patchwork
  2017-11-23  6:56 ` [PATCH] " Tvrtko Ursulin
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-11-23  0:06 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Save/restore irq state for vlv_residency_raw()
URL   : https://patchwork.freedesktop.org/series/34260/
State : success

== Summary ==

Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-pri-indfb-multidraw:
                incomplete -> PASS       (shard-hsw) fdo#103167
        Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-snb) fdo#101623
Test drv_module_reload:
        Subgroup basic-no-display:
                pass       -> DMESG-WARN (shard-hsw) fdo#102707
Test gem_busy:
        Subgroup close-race:
                fail       -> PASS       (shard-snb) fdo#103829

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#103829 https://bugs.freedesktop.org/show_bug.cgi?id=103829

shard-hsw        total:2667 pass:1525 dwarn:2   dfail:0   fail:18  skip:1122 time:9521s
shard-snb        total:2575 pass:1249 dwarn:1   dfail:0   fail:21  skip:1302 time:7678s
Blacklisted hosts:
shard-apl        total:2591 pass:1630 dwarn:4   dfail:0   fail:23  skip:932 time:12702s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7244/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw()
  2017-11-22 22:25 [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw() Chris Wilson
  2017-11-22 22:53 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-11-23  0:06 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-11-23  6:56 ` Tvrtko Ursulin
  2017-11-23  7:47   ` Chris Wilson
  2 siblings, 1 reply; 5+ messages in thread
From: Tvrtko Ursulin @ 2017-11-23  6:56 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 22/11/2017 22:25, Chris Wilson wrote:
> Since commit 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics"),
> vlv_residency_raw() may be called from an irq-disabled context (via perf
> event sampling on remote cpu). As such, we can no longer assume that we
> are called from process context and must save/restore the irq state for
> the spinlock.
> 
> Fixes: 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics")
> Testcase: igt/perf_pmu/other-init-3
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_pm.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 7d41aad79166..03d67d8ab647 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -9396,12 +9396,13 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
>   			     const i915_reg_t reg)
>   {
>   	u32 lower, upper, tmp;
> +	unsigned long flags;
>   	int loop = 2;
>   
>   	/* The register accessed do not need forcewake. We borrow
>   	 * uncore lock to prevent concurrent access to range reg.
>   	 */
> -	spin_lock_irq(&dev_priv->uncore.lock);
> +	spin_lock_irqsave(&dev_priv->uncore.lock, flags);
>   
>   	/* vlv and chv residency counters are 40 bits in width.
>   	 * With a control bit, we can choose between upper or lower
> @@ -9432,7 +9433,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
>   	 * now.
>   	 */
>   
> -	spin_unlock_irq(&dev_priv->uncore.lock);
> +	spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
>   
>   	return lower | (u64)upper << 8;
>   }
> @@ -9451,7 +9452,6 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
>   		mul = 1000000;
>   		div = dev_priv->czclk_freq;
>   		time_hw = vlv_residency_raw(dev_priv, reg);
> -
>   	} else {
>   		/* 833.33ns units on Gen9LP, 1.28us elsewhere. */
>   		if (IS_GEN9_LP(dev_priv)) {
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw()
  2017-11-23  6:56 ` [PATCH] " Tvrtko Ursulin
@ 2017-11-23  7:47   ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-11-23  7:47 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2017-11-23 06:56:49)
> 
> On 22/11/2017 22:25, Chris Wilson wrote:
> > Since commit 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics"),
> > vlv_residency_raw() may be called from an irq-disabled context (via perf
> > event sampling on remote cpu). As such, we can no longer assume that we
> > are called from process context and must save/restore the irq state for
> > the spinlock.
> > 
> > Fixes: 6060b6aec03c ("drm/i915/pmu: Add RC6 residency metrics")
> > Testcase: igt/perf_pmu/other-init-3
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >   drivers/gpu/drm/i915/intel_pm.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 7d41aad79166..03d67d8ab647 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -9396,12 +9396,13 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
> >                            const i915_reg_t reg)
> >   {
> >       u32 lower, upper, tmp;
> > +     unsigned long flags;
> >       int loop = 2;
> >   
> >       /* The register accessed do not need forcewake. We borrow
> >        * uncore lock to prevent concurrent access to range reg.
> >        */
> > -     spin_lock_irq(&dev_priv->uncore.lock);
> > +     spin_lock_irqsave(&dev_priv->uncore.lock, flags);
> >   
> >       /* vlv and chv residency counters are 40 bits in width.
> >        * With a control bit, we can choose between upper or lower
> > @@ -9432,7 +9433,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
> >        * now.
> >        */
> >   
> > -     spin_unlock_irq(&dev_priv->uncore.lock);
> > +     spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
> >   
> >       return lower | (u64)upper << 8;
> >   }
> > @@ -9451,7 +9452,6 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
> >               mul = 1000000;
> >               div = dev_priv->czclk_freq;
> >               time_hw = vlv_residency_raw(dev_priv, reg);
> > -
> >       } else {
> >               /* 833.33ns units on Gen9LP, 1.28us elsewhere. */
> >               if (IS_GEN9_LP(dev_priv)) {
> > 
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Ta, pushed this patch. Thanks for the review,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-11-23  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 22:25 [PATCH] drm/i915: Save/restore irq state for vlv_residency_raw() Chris Wilson
2017-11-22 22:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-23  0:06 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-23  6:56 ` [PATCH] " Tvrtko Ursulin
2017-11-23  7:47   ` Chris Wilson

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.