diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-02 10:22:25 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-04 11:34:02 -0400 |
commit | 645416f5adc87c8fae44289cdba7562f3ade8f5c (patch) | |
tree | 41d8d3de78364e08a453b25932c0f42ba1c30056 /drivers/gpu/drm/i915/i915_irq.c | |
parent | d4d36014ca37e6fa8271b0690e678b76456faa01 (diff) |
drm/i915: fix hpd work vs. flush_work in the pageflip code deadlock
Historically we've run our own driver hotplug handling in our own
work-queue, which then launched the drm core hotplug handling in the
system workqueue. This is important since we flush our own driver
workqueue in the pageflip code while hodling modeset locks, and only
the drm hotplug code grabbed these locks. But with
commit 69787f7da6b2adc4054357a661aaa1701a9ca76f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Tue Oct 23 18:23:34 2012 +0000
drm: run the hpd irq event code directly
this was changed and now we could deadlock in our flip handler if
there's a hotplug work blocking the progress of the crucial unpin
works. So this broke the careful deadlock avoidance implemented in
commit b4a98e57fc27854b5938fc8b08b68e5e68b91e1f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Nov 1 09:26:26 2012 +0000
drm/i915: Flush outstanding unpin tasks before pageflipping
Since the rule thus far has been that work items on our own workqueue
may never grab modeset locks simply restore that rule again.
v2: Add a comment to the declaration of dev_priv->wq to warn readers
about the tricky implications of using it. Suggested by Chris Wilson.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Stuart Abercrombie <sabercrombie@chromium.org>
Reported-by: Stuart Abercrombie <sabercrombie@chromium.org>
References: http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/26239
Cc: stable@vger.kernel.org
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Squash in a comment at the place where we schedule the work.
Requested after-the-fact by Chris on irc since the hpd work isn't the
only place we botch this.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 4c6853f57d62..9e48cf27db5e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1027,8 +1027,13 @@ static inline void intel_hpd_irq_handler(struct drm_device *dev, | |||
1027 | dev_priv->display.hpd_irq_setup(dev); | 1027 | dev_priv->display.hpd_irq_setup(dev); |
1028 | spin_unlock(&dev_priv->irq_lock); | 1028 | spin_unlock(&dev_priv->irq_lock); |
1029 | 1029 | ||
1030 | queue_work(dev_priv->wq, | 1030 | /* |
1031 | &dev_priv->hotplug_work); | 1031 | * Our hotplug handler can grab modeset locks (by calling down into the |
1032 | * fb helpers). Hence it must not be run on our own dev-priv->wq work | ||
1033 | * queue for otherwise the flush_work in the pageflip code will | ||
1034 | * deadlock. | ||
1035 | */ | ||
1036 | schedule_work(&dev_priv->hotplug_work); | ||
1032 | } | 1037 | } |
1033 | 1038 | ||
1034 | static void gmbus_irq_handler(struct drm_device *dev) | 1039 | static void gmbus_irq_handler(struct drm_device *dev) |