Re: [PATCH 4/4] drm/i915/gen9: Fix runtime PM refcounting in case DMC firmware isn't loaded

Chris Wilson
2016-04-18T07:49:42Z

On Mon, Apr 18, 2016 at 10:04:22AM +0300, Imre Deak wrote:
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index d57b00e..fd9f5b3 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c

> +void intel_csr_ucode_suspend(struct drm_i915_private *dev_priv)
> +{
> + if (!HAS_CSR(dev_priv))
> + return;
> +
> + flush_work(&dev_priv->csr.work);
> +
> + /* Drop the reference held in case DMC isn't loaded. */
> + if (!dev_priv->csr.dmc_payload)
> + intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> +}

> @@ -480,5 +480,34 @@ void intel_csr_ucode_fini(struct drm_i915_private *dev_priv)
>
> flush_work(&dev_priv->csr.work);
>
> + /* Drop the reference held in case DMC isn't loaded. */
> + if (!dev_priv->csr.dmc_payload)
> + intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> +
> kfree(dev_priv->csr.dmc_payload);
> }

Should fini just be calling suspend first?
-Chris

--
Chris Wilson, Intel Open Source Technology Centre