[Intel-gfx] [PATCH] drm/i915: WARN if the core runtime PM get helpers fail

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 28 10:11:55 UTC 2017


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 at 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 at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list