On Fri, 05 Aug 2011 12:04:16 -0700, <gre...@suse.de> wrote: > > This is a note to let you know that I've just added the patch titled > > drm/i915: Hold mode_config->mutex during hotplug processing > > to the 3.0-stable tree which can be found at: > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > The filename of the patch is: > drm-i915-hold-mode_config-mutex-during-hotplug-processing.patch > and it can be found in the queue-3.0 subdirectory. > > If you, or anyone else, feels it should not be added to the stable tree, > please let <sta...@kernel.org> know about it. > > > From a65e34c79c88895766ab1f8a5afa451eed26622b Mon Sep 17 00:00:00 2001 > From: Keith Packard <kei...@keithp.com> > Date: Mon, 25 Jul 2011 10:04:56 -0700 > Subject: drm/i915: Hold mode_config->mutex during hotplug processing > > From: Keith Packard <kei...@keithp.com> > > commit a65e34c79c88895766ab1f8a5afa451eed26622b upstream. > > Hotplug detection is a mode setting operation and must hold the > struct_mutex or risk colliding with other mode setting operations. > > In particular, the display port hotplug function attempts to re-train > the link if the monitor is supposed to be running when plugged back > in. If that happens while mode setting is underway, the link will get > scrambled, leaving it in an inconsistent state. > > This is a special case -- usually the driver mode setting entry points > are covered by the upper level DRM code, but in this case the function > is invoked as a work function not under the control of DRM. > > Signed-off-by: Keith Packard <kei...@keithp.com> > Reviewed-by: Jesse Barnes <jbar...@virtuousgeek.org> > Signed-off-by: Greg Kroah-Hartman <gre...@suse.de> > > --- > drivers/gpu/drm/i915/i915_irq.c | 3 +++ > 1 file changed, 3 insertions(+) > > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -306,6 +306,7 @@ static void i915_hotplug_work_func(struc > struct drm_mode_config *mode_config = &dev->mode_config; > struct intel_encoder *encoder; > > + mutex_lock(&mode_config->mutex); > DRM_DEBUG_KMS("running encoder hotplug functions\n"); > > list_for_each_entry(encoder, &mode_config->encoder_list, base.head) > @@ -314,6 +315,8 @@ static void i915_hotplug_work_func(struc > > /* Just fire off a uevent and let userspace tell us what to do */ > drm_helper_hpd_irq_event(dev); > + > + mutex_unlock(&mode_config->mutex); > }
There's a fixup for this patch -- some lock debugging didn't like holding the lock across the hpd_irq_event call. 40ee3381dd1010432acc13e907329029096c5bfc It should be in master, but didn't get a Cc: to stable. commit 40ee3381dd1010432acc13e907329029096c5bfc Author: Keith Packard <kei...@keithp.com> Date: Thu Jul 28 15:31:19 2011 -0700 drm/i915: Fixup for 'Hold mode_config->mutex during hotplug' drm_helper_hpd_irq_event queues another work proc to go and deliver the user-space event, and that function also wants to hold the config mutex, so we shouldn't hold the mutex across the drm_helper_hpd_irq_event call. Signed-off-by: Keith Packard <kei...@keithp.com> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 9da2a2c..9b1d669 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -313,10 +313,10 @@ static void i915_hotplug_work_func(struct work_struct *work) if (encoder->hot_plug) encoder->hot_plug(encoder); + mutex_unlock(&mode_config->mutex); + /* Just fire off a uevent and let userspace tell us what to do */ drm_helper_hpd_irq_event(dev); - - mutex_unlock(&mode_config->mutex); } static void i915_handle_rps_change(struct drm_device *dev) -- keith.pack...@intel.com
pgp9B9RxBwnY7.pgp
Description: PGP signature
_______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable