[v2,2/2] drm/i915/pm: Print offending domain in refcount failure

Submitted by Daniel Stone on Nov. 20, 2015, 3:55 p.m.

Details

Message ID 1448034934-11926-2-git-send-email-daniels@collabora.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Daniel Stone Nov. 20, 2015, 3:55 p.m.
If we experience a refcounting failure in a power domain/well (unref'ing at
least one too many times), log the name of the offending domain or well.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 754f9bd..7237dea 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -1499,11 +1499,15 @@  void intel_display_power_put(struct drm_i915_private *dev_priv,
 
 	mutex_lock(&power_domains->lock);
 
-	WARN_ON(!power_domains->domain_use_count[domain]);
+	WARN(!power_domains->domain_use_count[domain],
+	     "Use count on domain %s is already zero\n",
+	     intel_display_power_domain_str(domain));
 	power_domains->domain_use_count[domain]--;
 
 	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
-		WARN_ON(!power_well->count);
+		WARN(!power_well->count,
+		     "Use count on power well %s is already zero",
+		     power_well->name);
 
 		if (!--power_well->count)
 			intel_power_well_disable(dev_priv, power_well);

Comments

On Fri, Nov 20, 2015 at 03:55:34PM +0000, Daniel Stone wrote:
> If we experience a refcounting failure in a power domain/well (unref'ing at
> least one too many times), log the name of the offending domain or well.
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>

Both patches look OK to me
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 754f9bd..7237dea 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -1499,11 +1499,15 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
>  
>  	mutex_lock(&power_domains->lock);
>  
> -	WARN_ON(!power_domains->domain_use_count[domain]);
> +	WARN(!power_domains->domain_use_count[domain],
> +	     "Use count on domain %s is already zero\n",
> +	     intel_display_power_domain_str(domain));
>  	power_domains->domain_use_count[domain]--;
>  
>  	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
> -		WARN_ON(!power_well->count);
> +		WARN(!power_well->count,
> +		     "Use count on power well %s is already zero",
> +		     power_well->name);
>  
>  		if (!--power_well->count)
>  			intel_power_well_disable(dev_priv, power_well);
> -- 
> 2.5.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
On Fri, 20 Nov 2015, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, Nov 20, 2015 at 03:55:34PM +0000, Daniel Stone wrote:
>> If we experience a refcounting failure in a power domain/well (unref'ing at
>> least one too many times), log the name of the offending domain or well.
>> 
>> Signed-off-by: Daniel Stone <daniels@collabora.com>
>
> Both patches look OK to me
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Jani Nikula <jani.nikula@intel.com>


>
>> ---
>>  drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> index 754f9bd..7237dea 100644
>> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> @@ -1499,11 +1499,15 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
>>  
>>  	mutex_lock(&power_domains->lock);
>>  
>> -	WARN_ON(!power_domains->domain_use_count[domain]);
>> +	WARN(!power_domains->domain_use_count[domain],
>> +	     "Use count on domain %s is already zero\n",
>> +	     intel_display_power_domain_str(domain));
>>  	power_domains->domain_use_count[domain]--;
>>  
>>  	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
>> -		WARN_ON(!power_well->count);
>> +		WARN(!power_well->count,
>> +		     "Use count on power well %s is already zero",
>> +		     power_well->name);
>>  
>>  		if (!--power_well->count)
>>  			intel_power_well_disable(dev_priv, power_well);
>> -- 
>> 2.5.0
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
On ma, 2015-11-23 at 12:31 +0200, Jani Nikula wrote:
> On Fri, 20 Nov 2015, Ville Syrjälä <ville.syrjala@linux.intel.com>
> wrote:
> > On Fri, Nov 20, 2015 at 03:55:34PM +0000, Daniel Stone wrote:
> > > If we experience a refcounting failure in a power domain/well
> > > (unref'ing at
> > > least one too many times), log the name of the offending domain
> > > or well.
> > > 
> > > Signed-off-by: Daniel Stone <daniels@collabora.com>
> > 
> > Both patches look OK to me
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Acked-by: Jani Nikula <jani.nikula@intel.com>

Push both patches to dinq, thanks for the patch and review.

--Imre

> > > ---
> > >  drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > index 754f9bd..7237dea 100644
> > > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > @@ -1499,11 +1499,15 @@ void intel_display_power_put(struct
> > > drm_i915_private *dev_priv,
> > >  
> > >  	mutex_lock(&power_domains->lock);
> > >  
> > > -	WARN_ON(!power_domains->domain_use_count[domain]);
> > > +	WARN(!power_domains->domain_use_count[domain],
> > > +	     "Use count on domain %s is already zero\n",
> > > +	     intel_display_power_domain_str(domain));
> > >  	power_domains->domain_use_count[domain]--;
> > >  
> > >  	for_each_power_well_rev(i, power_well, BIT(domain),
> > > power_domains) {
> > > -		WARN_ON(!power_well->count);
> > > +		WARN(!power_well->count,
> > > +		     "Use count on power well %s is already
> > > zero",
> > > +		     power_well->name);
> > >  
> > >  		if (!--power_well->count)
> > >  			intel_power_well_disable(dev_priv,
> > > power_well);
> > > -- 
> > > 2.5.0
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>