Re: [PATCH 13/16] drm/i915: Do not print DC off mismatch state when DMC firmware in not loaded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-10-15 at 13:58 +0300, Imre Deak wrote:
> On Fri, Oct 12, 2018 at 02:52:15PM -0700, José Roberto de Souza
> wrote:
> > When DMC firmware is not loaded, it return earlier in
> > gen9_dc_off_power_well_disable() as it will have no effect without
> > DMC firmware loaded. But it will cause a mismatch state error when
> > running intel_power_domains_verify_state(), so skipping this error
> > in this case.
> 
> DC states are disabled when DMC is not loaded and we won't ever
> enable
> them, as runtime PM as a whole is disabled. So not sure why you get a
> mismatch error, but ignoring that by special casing it doesn't seem
> correct.

I just found out a bug that was hidden this bug from drm-tip, I just
sent a separated PR(https://patchwork.freedesktop.org/series/51039/)
with this patch and the fix please take a look.

But it was hidden because at every call to
intel_power_domains_verify_state() something was holding a reference to
one of DC_OFF domains, keeping it in the on state that means DC is
disabaled.
If you run drm-tip with the fix without any output all references to
DC_OFF domain will be release but as DMC firmware was not loaded DC is
not actualy enabled causing the state mismatch.
A easy way to reproduce is just run drm-tip with disable_display=1 and
check the error message in dmesg.

Although I'm not 100% happy with the way that I'm identifying DC_OFF
power well, do you have suggestion?

> 
> > Signed-off-by: José Roberto de Souza <jose.souza@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_runtime_pm.c | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > index 8b1c4d0db0af..629091ad8337 100644
> > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > @@ -4014,11 +4014,22 @@ static void
> > intel_power_domains_verify_state(struct drm_i915_private *dev_priv)
> >  		enabled = power_well->desc->ops->is_enabled(dev_priv,
> >  							    power_well)
> > ;
> >  		if ((power_well->count || power_well->desc->always_on)
> > !=
> > -		    enabled)
> > +		    enabled) {
> > +			/* If DMC firmware is not loaded it could cause
> > a
> > +			 * mismatch state as we can't disable DC off,
> > so let's
> > +			 * do not print any errors in this scenario.
> > +			 */
> > +
> > +			if (!strcmp("DC off", power_well->desc->name)
> > &&
> > +			    !dev_priv->csr.dmc_payload)
> > +				goto skip_state_mismatch_error;
> > +
> >  			DRM_ERROR("power well %s state mismatch
> > (refcount %d/enabled %d)",
> >  				  power_well->desc->name,
> >  				  power_well->count, enabled);
> > +		}
> >  
> > +skip_state_mismatch_error:
> >  		domains_count = 0;
> >  		for_each_power_domain(domain, power_well->desc-
> > >domains)
> >  			domains_count += power_domains-
> > >domain_use_count[domain];
> > -- 
> > 2.19.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux