public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Hold struct_mutex during hotplug processing
@ 2011-07-25 17:10 Keith Packard
  2011-07-25 17:37 ` [Intel-gfx] " Jesse Barnes
  2011-07-26  7:24 ` Daniel Vetter
  0 siblings, 2 replies; 14+ messages in thread
From: Keith Packard @ 2011-07-25 17:10 UTC (permalink / raw)
  To: Dave Airlie; +Cc: linux-kernel, dri-devel, intel-gfx, Keith Packard

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.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/gpu/drm/i915/i915_irq.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 3b03f85..5fe8f28 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -306,12 +306,15 @@ static void i915_hotplug_work_func(struct work_struct *work)
 	struct drm_mode_config *mode_config = &dev->mode_config;
 	struct intel_encoder *encoder;
 
+	mutex_lock(&dev_priv->dev->struct_mutex);
 	DRM_DEBUG_KMS("running encoder hotplug functions\n");
 
 	list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
 		if (encoder->hot_plug)
 			encoder->hot_plug(encoder);
 
+	mutex_unlock(&dev_priv->dev->struct_mutex);
+
 	/* Just fire off a uevent and let userspace tell us what to do */
 	drm_helper_hpd_irq_event(dev);
 }
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-07-29 10:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 17:10 [PATCH] drm/i915: Hold struct_mutex during hotplug processing Keith Packard
2011-07-25 17:37 ` [Intel-gfx] " Jesse Barnes
2011-07-25 17:40   ` Andrew Lutomirski
2011-07-25 17:55     ` Keith Packard
2011-07-26  2:52   ` Andrew Lutomirski
2011-07-26  5:54     ` Keith Packard
2011-07-26 12:35       ` Andrew Lutomirski
2011-07-26  7:24 ` Daniel Vetter
2011-07-26 15:23   ` Keith Packard
2011-07-26 19:12     ` Jesse Barnes
2011-07-27  9:21       ` Keith Packard
2011-07-27 16:03         ` Jesse Barnes
2011-07-28 22:50           ` Keith Packard
2011-07-29 10:25             ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox