From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 2/4] drm/i915: cancel hotplug and dig_port work during suspend and unload Date: Tue, 12 Aug 2014 16:39:49 +0300 Message-ID: <1407850789.11068.24.camel@intelbox> References: <1407783257-29468-1-git-send-email-imre.deak@intel.com> <20140812121356.GW4193@intel.com> <1407846961.11068.11.camel@intelbox> <20140812125347.GZ4193@intel.com> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0885856917==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 501EE6E4DB for ; Tue, 12 Aug 2014 06:39:55 -0700 (PDT) In-Reply-To: <20140812125347.GZ4193@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0885856917== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-snK33FnfXzyTo+RHtiai" --=-snK33FnfXzyTo+RHtiai Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2014-08-12 at 15:53 +0300, Ville Syrj=C3=A4l=C3=A4 wrote: > On Tue, Aug 12, 2014 at 03:36:01PM +0300, Imre Deak wrote: > > On Tue, 2014-08-12 at 15:13 +0300, Ville Syrj=C3=A4l=C3=A4 wrote: > > > On Mon, Aug 11, 2014 at 09:54:15PM +0300, Imre Deak wrote: > > > > Make sure these work handlers don't run after we system suspend or > > > > unload the driver. Note that we don't cancel the handlers during ru= ntime > > > > suspend. That could lead to a lockup, since we take a runtime PM re= f > > > > from the handlers themselves. Fortunaltely canceling there is not n= eeded > > > > since the RPM ref itself provides for the needed serialization. > > > >=20 > > > > Signed-off-by: Imre Deak > > > > --- > > > > drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++ > > > > drivers/gpu/drm/i915/i915_drv.h | 1 + > > > > drivers/gpu/drm/i915/intel_display.c | 3 +-- > > > > 3 files changed, 10 insertions(+), 2 deletions(-) > > > >=20 > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915= /i915_drv.c > > > > index ec96f9a..0653761 100644 > > > > --- a/drivers/gpu/drm/i915/i915_drv.c > > > > +++ b/drivers/gpu/drm/i915/i915_drv.c > > > > @@ -494,6 +494,13 @@ bool i915_semaphore_is_enabled(struct drm_devi= ce *dev) > > > > return true; > > > > } > > > > =20 > > > > +void intel_hpd_cancel_work(struct drm_i915_private *dev_priv) > > > > +{ > > > > + cancel_work_sync(&dev_priv->hotplug_work); > > > > + cancel_work_sync(&dev_priv->dig_port_work); > > >=20 > > > Since dig_port_work can queue a hotplug_work shouldn't these two be > > > swapped? > >=20 > > Right, will fix that. > >=20 > > > I wonder if we should also clear hpd_event_bits and > > > {long,short}_hpd_port_mask before cancelling the works? At least it > > > might make the works end a bit quicker if the are already running. > >=20 > > Makes sense for speed, will fix it. Another thing is that a final > > instance of these works can now run with interrupts disabled that could > > cause DP AUX timeouts for example. That could be avoided for example by > > adding a new dev_priv->hpd_irqs_disabled flag and setting it before > > disabling interrupts, but I didn't want to make things more complicated > > before getting some feedback. > >=20 > > > I also noticed that we don't seem to grab any rpm/powerwell reference= s > > > in ->hpd_pulse() or i915_digport_work_func(). That doesn't seem right= . > > > Or maybe you already addressed that in another patch? > >=20 > > No, I haven't. I thought it's enough that all low level functions like > > DPCD read, link training do take already the needed refs. Isn't that > > enough? >=20 > There's at least the call to ibx_digital_port_connected() which isn't > covered by any rpm/powerwell reference. Right, haven't noticed :/ I can fix this by taking the display port power domain around ->hpd_pulse(), similar to all the other DP encoder/connector handlers (get_modes, detect etc.).=20 --Imre --=-snK33FnfXzyTo+RHtiai Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJT6hklAAoJEORIIAnNuWDFtjsH/2BGLMaoovxqOCzTR7s7OZIL MZulSxRLOEYHCd9SCqt57zHxZIrQhXtwrHAenwPKdf2zUEF1eLNQkVpWhvPsI4fB 4TxiFFpf3MIbVkFelg2lfWGwlTYT9uvgxIJxZcy+byxLatpbi3dsOP00prHaGgWr fDnpTg/GffCaL8XTIdC7VFyF2djmeMrFGbgjKza6vX5lAhzTVLvlyUKkBbm9dAne LycGZCGV4TT6/gmpLm/a04aj2VJ3sS6TwEYYydnvgOWX881zLeBLqb7feffOGtjF WW0RghN1mHwxrhdzHSbUqWZzBdMcn3iOF6F3ALAvgjnN3jgXMynUu2TTU+UFiC0= =ft6k -----END PGP SIGNATURE----- --=-snK33FnfXzyTo+RHtiai-- --===============0885856917== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0885856917==--