All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: WARN if the core runtime PM get helpers fail
@ 2017-03-28  9:38 Imre Deak
  2017-03-28  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-03-28 10:11 ` [PATCH] " Chris Wilson
  0 siblings, 2 replies; 5+ messages in thread
From: Imre Deak @ 2017-03-28  9:38 UTC (permalink / raw)
  To: intel-gfx

We don't expect the core runtime PM get helpers to return any error, so
add a WARN for this. Also print the return value for all the callsites
to help debugging.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 0fb5bfb..eac2df4 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2845,8 +2845,9 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
 {
 	struct pci_dev *pdev = dev_priv->drm.pdev;
 	struct device *kdev = &pdev->dev;
+	int ret = pm_runtime_get_sync(kdev);
 
-	pm_runtime_get_sync(kdev);
+	WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
 
 	atomic_inc(&dev_priv->pm.wakeref_count);
 	assert_rpm_wakelock_held(dev_priv);
@@ -2876,7 +2877,8 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv)
 		 * function, since the power state is undefined. This applies
 		 * atm to the late/early system suspend/resume handlers.
 		 */
-		WARN_ON_ONCE(ret < 0);
+		WARN_ONCE(ret < 0,
+			  "pm_runtime_get_if_in_use() failed: %d\n", ret);
 		if (ret <= 0)
 			return false;
 	}
@@ -2960,8 +2962,11 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
 	 * platforms without RPM support.
 	 */
 	if (!HAS_RUNTIME_PM(dev_priv)) {
+		int ret;
+
 		pm_runtime_dont_use_autosuspend(kdev);
-		pm_runtime_get_sync(kdev);
+		ret = pm_runtime_get_sync(kdev);
+		WARN(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
 	} else {
 		pm_runtime_use_autosuspend(kdev);
 	}
-- 
2.5.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: WARN if the core runtime PM get helpers fail
  2017-03-28  9:38 [PATCH] drm/i915: WARN if the core runtime PM get helpers fail Imre Deak
@ 2017-03-28  9:58 ` Patchwork
  2017-03-28 13:45   ` Imre Deak
  2017-03-28 10:11 ` [PATCH] " Chris Wilson
  1 sibling, 1 reply; 5+ messages in thread
From: Patchwork @ 2017-03-28  9:58 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: WARN if the core runtime PM get helpers fail
URL   : https://patchwork.freedesktop.org/series/21997/
State : success

== Summary ==

Series 21997v1 drm/i915: WARN if the core runtime PM get helpers fail
https://patchwork.freedesktop.org/api/1.0/series/21997/revisions/1/mbox/

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 460s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time: 453s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 582s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 545s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 575s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 510s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 509s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 442s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 432s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 443s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 518s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 515s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 485s
fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 598s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 475s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 603s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 485s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 527s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time: 457s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 549s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time: 417s

2b51c2073441cc5b3b18c7e0e8716cbf3736e873 drm-tip: 2017y-03m-28d-08h-54m-35s UTC integration manifest
cb53f2d drm/i915: WARN if the core runtime PM get helpers fail

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4323/
_______________________________________________
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: WARN if the core runtime PM get helpers fail
  2017-03-28  9:38 [PATCH] drm/i915: WARN if the core runtime PM get helpers fail Imre Deak
  2017-03-28  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-28 10:11 ` Chris Wilson
  2017-03-28 12:22   ` Imre Deak
  1 sibling, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2017-03-28 10:11 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

On Tue, Mar 28, 2017 at 12:38:55PM +0300, Imre Deak wrote:
> We don't expect the core runtime PM get helpers to return any error, so
> add a WARN for this. Also print the return value for all the callsites
> to help debugging.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 0fb5bfb..eac2df4 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -2845,8 +2845,9 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
>  {
>  	struct pci_dev *pdev = dev_priv->drm.pdev;
>  	struct device *kdev = &pdev->dev;
> +	int ret = pm_runtime_get_sync(kdev);

Only don't hide this in the locals block. This is the most important
step of the function, it should be clearly visible.

> -	pm_runtime_get_sync(kdev);
> +	WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);

Ok, no error propagation, WARN makes sense. With the tweak above,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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: WARN if the core runtime PM get helpers fail
  2017-03-28 10:11 ` [PATCH] " Chris Wilson
@ 2017-03-28 12:22   ` Imre Deak
  0 siblings, 0 replies; 5+ messages in thread
From: Imre Deak @ 2017-03-28 12:22 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Tue, Mar 28, 2017 at 11:11:55AM +0100, Chris Wilson wrote:
> On Tue, Mar 28, 2017 at 12:38:55PM +0300, Imre Deak wrote:
> > We don't expect the core runtime PM get helpers to return any error, so
> > add a WARN for this. Also print the return value for all the callsites
> > to help debugging.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_runtime_pm.c | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > index 0fb5bfb..eac2df4 100644
> > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > @@ -2845,8 +2845,9 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
> >  {
> >  	struct pci_dev *pdev = dev_priv->drm.pdev;
> >  	struct device *kdev = &pdev->dev;
> > +	int ret = pm_runtime_get_sync(kdev);
> 
> Only don't hide this in the locals block. This is the most important
> step of the function, it should be clearly visible.

Ok, will change this.

> 
> > -	pm_runtime_get_sync(kdev);
> > +	WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
> 
> Ok, no error propagation, WARN makes sense. With the tweak above,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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: ✓ Fi.CI.BAT: success for drm/i915: WARN if the core runtime PM get helpers fail
  2017-03-28  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-28 13:45   ` Imre Deak
  0 siblings, 0 replies; 5+ messages in thread
From: Imre Deak @ 2017-03-28 13:45 UTC (permalink / raw)
  To: intel-gfx, Chris Wilson

On Tue, Mar 28, 2017 at 09:58:51AM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: WARN if the core runtime PM get helpers fail
> URL   : https://patchwork.freedesktop.org/series/21997/
> State : success
> 
> == Summary ==
> 
> Series 21997v1 drm/i915: WARN if the core runtime PM get helpers fail
> https://patchwork.freedesktop.org/api/1.0/series/21997/revisions/1/mbox/

Thanks for the review, I pushed the patch with the tweak.

--Imre

> 
> fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 460s
> fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time: 453s
> fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 582s
> fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 545s
> fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 575s
> fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 510s
> fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 509s
> fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 442s
> fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 432s
> fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 443s
> fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 518s
> fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 515s
> fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 485s
> fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 598s
> fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 475s
> fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 603s
> fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 485s
> fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 527s
> fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time: 457s
> fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 549s
> fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time: 417s
> 
> 2b51c2073441cc5b3b18c7e0e8716cbf3736e873 drm-tip: 2017y-03m-28d-08h-54m-35s UTC integration manifest
> cb53f2d drm/i915: WARN if the core runtime PM get helpers fail
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4323/
_______________________________________________
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-03-28 13:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  9:38 [PATCH] drm/i915: WARN if the core runtime PM get helpers fail Imre Deak
2017-03-28  9:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-28 13:45   ` Imre Deak
2017-03-28 10:11 ` [PATCH] " Chris Wilson
2017-03-28 12:22   ` Imre Deak

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.