diff mbox

[6/6] drm/i915/guc: Grab RPM wakelock while disabling GuC interrupts

Message ID 1505109744-29688-6-git-send-email-sagar.a.kamble@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sagar.a.kamble@intel.com Sept. 11, 2017, 6:02 a.m. UTC
Disabling GuC interrupts involves access to GuC IRQ control registers
hence ensure device is RPM awake.

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michal Wajdeczko Sept. 11, 2017, 5:34 p.m. UTC | #1
On Mon, Sep 11, 2017 at 11:32:24AM +0530, Sagar Arun Kamble wrote:
> Disabling GuC interrupts involves access to GuC IRQ control registers
> hence ensure device is RPM awake.
> 
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_guc_log.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
> index ba36162..d7557b5 100644
> --- a/drivers/gpu/drm/i915/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/intel_guc_log.c
> @@ -657,8 +657,10 @@ void i915_guc_log_unregister(struct drm_i915_private *dev_priv)
>  		return;
>  
>  	mutex_lock(&dev_priv->drm.struct_mutex);
> +	intel_runtime_pm_get(dev_priv);
>  	/* GuC logging is currently the only user of Guc2Host interrupts */
>  	gen9_disable_guc_interrupts(dev_priv);
> +	intel_runtime_pm_put(dev_priv);

There are other places in this file where guc interrupts are enabled/disabled.
Shouldn't we do the same there ?

Regards,
Michal

>  	guc_log_runtime_destroy(&dev_priv->guc);
>  	mutex_unlock(&dev_priv->drm.struct_mutex);
>  }
> -- 
> 1.9.1
>
sagar.a.kamble@intel.com Sept. 12, 2017, 4:33 a.m. UTC | #2
On 9/11/2017 11:04 PM, Michal Wajdeczko wrote:
> On Mon, Sep 11, 2017 at 11:32:24AM +0530, Sagar Arun Kamble wrote:
>> Disabling GuC interrupts involves access to GuC IRQ control registers
>> hence ensure device is RPM awake.
>>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_guc_log.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
>> index ba36162..d7557b5 100644
>> --- a/drivers/gpu/drm/i915/intel_guc_log.c
>> +++ b/drivers/gpu/drm/i915/intel_guc_log.c
>> @@ -657,8 +657,10 @@ void i915_guc_log_unregister(struct drm_i915_private *dev_priv)
>>   		return;
>>   
>>   	mutex_lock(&dev_priv->drm.struct_mutex);
>> +	intel_runtime_pm_get(dev_priv);
>>   	/* GuC logging is currently the only user of Guc2Host interrupts */
>>   	gen9_disable_guc_interrupts(dev_priv);
>> +	intel_runtime_pm_put(dev_priv);
> There are other places in this file where guc interrupts are enabled/disabled.
> Shouldn't we do the same there ?
>
> Regards,
> Michal
Those are already covered by the RPM locks along the paths 
i915_gem_init_hw, i915_guc_log_control, guc_unpause, guc_pause caller in 
system suspend, i915_reset.
>
>>   	guc_log_runtime_destroy(&dev_priv->guc);
>>   	mutex_unlock(&dev_priv->drm.struct_mutex);
>>   }
>> -- 
>> 1.9.1
>>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index ba36162..d7557b5 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -657,8 +657,10 @@  void i915_guc_log_unregister(struct drm_i915_private *dev_priv)
 		return;
 
 	mutex_lock(&dev_priv->drm.struct_mutex);
+	intel_runtime_pm_get(dev_priv);
 	/* GuC logging is currently the only user of Guc2Host interrupts */
 	gen9_disable_guc_interrupts(dev_priv);
+	intel_runtime_pm_put(dev_priv);
 	guc_log_runtime_destroy(&dev_priv->guc);
 	mutex_unlock(&dev_priv->drm.struct_mutex);
 }