[Intel-gfx] [PATCH v1 1/1] drm/i915: Hold RPM reference while setting freq limits through sysfs

Jani Nikula jani.nikula at linux.intel.com
Mon Feb 8 09:25:49 UTC 2016


On Fri, 05 Feb 2016, Sagar Arun Kamble <sagar.a.kamble at intel.com> wrote:
> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>

Please add a commit message saying why, and what blows up without
this. It may be obvious to you, but there's no harm in spelling it out.

BR,
Jani.


> ---
>  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);
> +
>  	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;
>  
>  }

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list