From: "Souza, Jose" Subject: Re: [PATCH 3/7] drm/i915/psr: Initialize PSR mutex even when sink is not reliable Date: Thu, 4 Apr 2019 19:25:56 +0000 Message-ID: <63508398f1c50c81d984ba54292df7aae4335b17.camel@intel.com> References: <20190403233539.31828-1-jose.souza@intel.com> <20190403233539.31828-3-jose.souza@intel.com> <20190404002748.GC25758@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1103099305==" Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBCFA6E0CF for ; Thu, 4 Apr 2019 19:25:58 +0000 (UTC) In-Reply-To: <20190404002748.GC25758@intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Vivi, Rodrigo" Cc: "intel-gfx@lists.freedesktop.org" , "Pandiyan, Dhinakaran" List-Id: intel-gfx@lists.freedesktop.org --===============1103099305== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-L5ELSXzSafMaNPnzVDxQ" --=-L5ELSXzSafMaNPnzVDxQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-04-03 at 17:27 -0700, Rodrigo Vivi wrote: > On Wed, Apr 03, 2019 at 04:35:35PM -0700, Jos=C3=A9 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. > >=20 > > Cc: Dhinakaran Pandiyan > > Cc: Rodrigo Vivi > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > --- > > drivers/gpu/drm/i915/intel_psr.c | 1 - > > 1 file changed, 1 deletion(-) > >=20 > > 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 =3D true; > > - return; >=20 > 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. >=20 > > } > > =20 > > /* Set link_standby x link_off defaults */ > > --=20 > > 2.21.0 > >=20 --=-L5ELSXzSafMaNPnzVDxQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEVNG051EijGa0MiaQVenbO/mOWkkFAlymWkMACgkQVenbO/mO Wkk28Qf/QGd153dvC10lzl3FF2gOipDIlHuSkWmvJipYHT+wSk3F/1Bc38IRNzQe ea14WIP9VsvlYFr0FPFcQht9WOSrTEoDeC4GCBcr8/2g2yIZC3h5SuOWcPNY28sz JkDWEVahBXqXpwZLMzk5bzwBUFZ8/1APM0BCEZphAJVEGsFLeTafhlB8Q3C+VMQq T8IUqJxzWRHuAK/fJH8JN71StVZP0WFucqBae4Y+JSY0oHYM7+e655gOXYEoN83S r2Fsn+saOJntmHmkPhC/yXIqIn47xBfyl1Vzlwm6mcJbQJZK+2rHH1ZqZtUMbMd0 BUIZ+h3SOircN5rXMj5dtuZy6+TsIQ== =en1i -----END PGP SIGNATURE----- --=-L5ELSXzSafMaNPnzVDxQ-- --===============1103099305== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============1103099305==--