[Intel-gfx] [PATCH 3/7] drm/i915/psr: Initialize PSR mutex even when sink is not reliable

Souza, Jose jose.souza at intel.com
Thu Apr 4 19:25:56 UTC 2019


On Wed, 2019-04-03 at 17:27 -0700, Rodrigo Vivi wrote:
> On Wed, Apr 03, 2019 at 04:35:35PM -0700, José Roberto de Souza
> wrote:
> > Even when driver is reloaded and hits this scenario the PSR mutex
> > should be initialized, otherwise reading PSR debugfs status will
> > execute mutex_lock() over a mutex that was not initialized.
> > 
> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_psr.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_psr.c
> > b/drivers/gpu/drm/i915/intel_psr.c
> > index c80bb3003a7d..a84da931c3be 100644
> > --- a/drivers/gpu/drm/i915/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > @@ -1227,7 +1227,6 @@ void intel_psr_init(struct drm_i915_private
> > *dev_priv)
> >  	if (val) {
> >  		DRM_DEBUG_KMS("PSR interruption error set\n");
> >  		dev_priv->psr.sink_not_reliable = true;
> > -		return;
> 
> There are other returns above and if debugfs hits this case maybe it
> is worth to move the mutex initialization up instead?


We have those two returns in PSR debugfs, !HAS_PSR(dev_priv) and !psr-
>sink_support and in this cases we don't have any PSR functionality so
not worthy to initialize anything PSR related.

> 
> >  	}
> >  
> >  	/* Set link_standby x link_off defaults */
> > -- 
> > 2.21.0
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20190404/8ad7d6df/attachment-0001.sig>


More information about the Intel-gfx mailing list