From: Keith Packard Subject: Re: [Intel-gfx] [PATCH] drm/i915: Hold struct_mutex during hotplug processing Date: Thu, 28 Jul 2011 15:50:00 -0700 Message-ID: References: <1311613829-4990-1-git-send-email-keithp@keithp.com> <20110726121225.3ae7acce@jbarnes-desktop> <20110727090331.60e0c5be@jbarnes-desktop> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: In-Reply-To: <20110727090331.60e0c5be@jbarnes-desktop> Sender: linux-kernel-owner@vger.kernel.org To: Jesse Barnes Cc: Daniel Vetter , Dave Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --=-=-= Content-Transfer-Encoding: quoted-printable On Wed, 27 Jul 2011 09:03:31 -0700, Jesse Barnes = wrote: > On Wed, 27 Jul 2011 02:21:24 -0700 > Keith Packard wrote: >=20 > > On Tue, 26 Jul 2011 12:12:25 -0700, Jesse Barnes wrote: > >=20 > > > I'd like to amend my reviewed by and say the lock shouldn't be held > > > around the call to the drm helper function. It queues some work that > > > also takes the mode config lock, which will break. So you can drop it > > > before that... Previously I had only checked our internal driver > > > callbacks but missed that the lock was held across the helper too. > >=20 > > So the work may get executed immediately rather than being run later at > > some point? >=20 > It sure looks that way... but I don't remember any rule about work > queue items having inter dependencies like this. Sounds fine; I've stuck a fixup that moves the mutex_unlock: if (encoder->hot_plug) encoder->hot_plug(encoder); =20 + mutex_unlock(&mode_config->mutex); + /* Just fire off a uevent and let userspace tell us what to do */ drm_helper_hpd_irq_event(dev); =2D =2D mutex_unlock(&mode_config->mutex); } =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFOMeeYQp8BWwlsTdMRArD3AJ9VProGSHXs+9r3a4B1Rzz0z/UuYQCfXfnI gIdX3ZuxMYw0uy+uRg5NoNg= =SL4g -----END PGP SIGNATURE----- --=-=-=--