All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Andrew Lutomirski <luto@mit.edu>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: 3.0 (or SNA?) regression: failed to train DP, aborting
Date: Mon, 25 Jul 2011 10:41:52 -0700	[thread overview]
Message-ID: <yunbowiuujj.fsf@aiko.keithp.com> (raw)
In-Reply-To: <CAObL_7EsiMoNUAo7oEZHsyKKc8RF_Kj2Hd-2t2QT5h9WRRV0Mg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2074 bytes --]

On Mon, 25 Jul 2011 13:15:54 -0400, Andrew Lutomirski <luto@mit.edu> wrote:

> Done.

Jesse Barnes and I discovered, much to our horror, that the hotplugging
path isn't holding the struct mutex while attempting to retrain the DP
link. That means that an application could well be doing a bit of
overlapping modesetting fun. And, it seems like the trace you provided
shows precisely that happening.

Care to try this patch? It's fixed my persistent hot-unplug problems.

From bba6ccca57f0536fb5aae278527939d7247a1f53 Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@keithp.com>
Date: Mon, 25 Jul 2011 10:04:56 -0700
Subject: [PATCH] drm/i915: Hold struct_mutex during hotplug processing

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



-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2011-07-25 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23 18:40 3.0 (or SNA?) regression: failed to train DP, aborting Andrew Lutomirski
2011-07-24  2:51 ` Andrew Lutomirski
2011-07-25  4:54 ` Keith Packard
2011-07-25 15:23   ` Andrew Lutomirski
2011-07-25 16:08     ` Keith Packard
2011-07-25 17:15       ` Andrew Lutomirski
2011-07-25 17:41         ` Keith Packard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yunbowiuujj.fsf@aiko.keithp.com \
    --to=keithp@keithp.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=luto@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.