From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Keith Packard <keithp@keithp.com>
Cc: Dave Airlie <airlied@redhat.com>,
intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Hold struct_mutex during hotplug processing
Date: Mon, 25 Jul 2011 10:37:32 -0700 [thread overview]
Message-ID: <20110725103732.623d7b65@jbarnes-desktop> (raw)
In-Reply-To: <1311613829-4990-1-git-send-email-keithp@keithp.com>
On Mon, 25 Jul 2011 10:10:29 -0700
Keith Packard <keithp@keithp.com> wrote:
> 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);
> }
yay, sounds like this will fix Andrew's problem and probably lots of
other random DP related failures.
Looks like the ->detect function is similarly protected at the call
site (though one level up in ->fill_modes), so it should be safe.
Looks like all the call sites in the link_status function are safe too.
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Let's get this one upstream asap. Should probably be cc'd to
stable@kernel.org as well.
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2011-07-25 17:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-25 17:10 [PATCH] drm/i915: Hold struct_mutex during hotplug processing Keith Packard
2011-07-25 17:37 ` Jesse Barnes [this message]
2011-07-25 17:40 ` [Intel-gfx] " 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
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=20110725103732.623d7b65@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=keithp@keithp.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox