From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Packard Subject: Re: 3.0 (or SNA?) regression: failed to train DP, aborting Date: Mon, 25 Jul 2011 10:41:52 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1136987853==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id E11519F02F for ; Mon, 25 Jul 2011 10:41:55 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Andrew Lutomirski Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1136987853== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 25 Jul 2011 13:15:54 -0400, Andrew Lutomirski 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=20bba6ccca57f0536fb5aae278527939d7247a1f53 Mon Sep 17 00:00:00 2001 From: Keith Packard 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 =2D-- 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_ir= q.c index 3b03f85..5fe8f28 100644 =2D-- 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 =3D &dev->mode_config; struct intel_encoder *encoder; =20 + mutex_lock(&dev_priv->dev->struct_mutex); DRM_DEBUG_KMS("running encoder hotplug functions\n"); =20 list_for_each_entry(encoder, &mode_config->encoder_list, base.head) if (encoder->hot_plug) encoder->hot_plug(encoder); =20 + 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); } =2D-=20 1.7.5.4 =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFOLargQp8BWwlsTdMRAplZAKDZqS+/K32ISLwohZe5+W1kdeJuawCdEMnF HapytMieIpRA2eXsjibpMEE= =8oHi -----END PGP SIGNATURE----- --=-=-=-- --===============1136987853== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1136987853==--