From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Avoid double mutex lock applying pipe A quirk during sanitize_crtc() Date: Tue, 10 Jun 2014 11:22:36 +0200 Message-ID: <20140610092236.GJ5821@phenom.ffwll.local> References: <5394EE4E.3040402@rus.uni-stuttgart.de> <1402296430-5065-1-git-send-email-chris@chris-wilson.co.uk> <20140609083025.GL27580@intel.com> <20140610070207.GD5821@phenom.ffwll.local> <20140610085351.GW27580@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by gabe.freedesktop.org (Postfix) with ESMTP id A58EC6E0B2 for ; Tue, 10 Jun 2014 02:22:43 -0700 (PDT) Received: by mail-wi0-f180.google.com with SMTP id hi2so3480087wib.13 for ; Tue, 10 Jun 2014 02:22:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140610085351.GW27580@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: Thomas Richter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Jun 10, 2014 at 11:53:51AM +0300, Ville Syrj=E4l=E4 wrote: > On Tue, Jun 10, 2014 at 09:02:07AM +0200, Daniel Vetter wrote: > > On Mon, Jun 09, 2014 at 11:30:26AM +0300, Ville Syrj=E4l=E4 wrote: > > > On Mon, Jun 09, 2014 at 07:47:10AM +0100, Chris Wilson wrote: > > > > Thomas found that his machine would deadlock reloading the i915.ko > > > > module after resume. He identified that this was caused by the > > > > reacquisition of the connection mutex inside intel_enable_pipe_a() > > > > during the CRTC sanitization routine. This will only affect machines > > > > that quirk PIPE A, i.e. the original 830m chipsets. > > > > = > > > > This patch move the locking into a wrapper function so that > > > > intel_enable_pipe_a() can bypass the locking knowing that it already > > > > holds the correct locks. > > > = > > > It can still try to grab crtc->mutex twice. Looks like Danial undid my > > > fix to not take all the modeset locks around > > > intel_modeset_setup_hw_state(). > > = > > Hm, I didn't find anything in git logs and we've had places where we us= ed > > modeset_lock_all since a long time. And I don't see how Chris' patch > > wouldn't address this here. Can you please explain? > = > I added the modeset_all locking here: > commit 027476642811f8559cbe00ef6cc54db230e48a20 > Author: Ville Syrj=E4l=E4 > Date: Mon Dec 2 11:08:06 2013 +0200 > = > drm/i915: Take modeset locks around intel_modeset_setup_hw_state() > = > and then had to reduce it to just the mode_config.mutex precisely due to > the pipe A quirk here: > commit 7ad228b11ec26a820291c9f5a1168d6176580dc1 > Author: Ville Syrj=E4l=E4 > Date: Tue Jan 7 16:15:36 2014 +0200 > = > drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init() Hm, indeed missed this since we have a bunch of other places that still do the full modeset_lock_all, but probably not possible to hit the pipe A quirk there. The ww mutex code makes this a bit more annoying so I guess Chris' patch with having a lock-less pipe A quirk is the way to go. But that one needs to be updated for latest drm-next/-nightly. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch