[Intel-gfx] [PATCH v1 1/1] drm/i915: Hold RPM reference while setting freq limits through sysfs
Ville Syrjälä
ville.syrjala at linux.intel.com
Mon Feb 8 15:24:06 UTC 2016
On Sat, Feb 06, 2016 at 12:25:01AM +0530, Sagar Arun Kamble wrote:
> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> ---
> drivers/gpu/drm/i915/i915_sysfs.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index c6188dd..bb2fd78 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -370,6 +370,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
>
> flush_delayed_work(&dev_priv->rps.delayed_resume_work);
>
> + intel_runtime_pm_get(dev_priv);
> +
> mutex_lock(&dev_priv->rps.hw_lock);
>
> val = intel_freq_opcode(dev_priv, val);
> @@ -398,6 +400,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
>
> mutex_unlock(&dev_priv->rps.hw_lock);
>
> + intel_runtime_pm_put(dev_priv);
> +
There's a return statement somewhere within the function too. You need to drop
the rpm ref there as well.
> return count;
> }
>
> @@ -433,6 +437,8 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
>
> flush_delayed_work(&dev_priv->rps.delayed_resume_work);
>
> + intel_runtime_pm_get(dev_priv);
> +
> mutex_lock(&dev_priv->rps.hw_lock);
>
> val = intel_freq_opcode(dev_priv, val);
> @@ -457,6 +463,8 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
>
> mutex_unlock(&dev_priv->rps.hw_lock);
>
> + intel_runtime_pm_put(dev_priv);
> +
> return count;
>
> }
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
More information about the Intel-gfx
mailing list