From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Chris Wilson <chris@chris-wilson.co.uk>,
Stuart Abercrombie <sabercrombie@chromium.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [ 23/71] drm/i915: fix hpd work vs. flush_work in the pageflip code deadlock
Date: Sun, 29 Sep 2013 12:27:35 -0700 [thread overview]
Message-ID: <20130929192645.106139871@linuxfoundation.org> (raw)
In-Reply-To: <20130929192643.539596256@linuxfoundation.org>
3.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <daniel.vetter@ffwll.ch>
commit 645416f5adc87c8fae44289cdba7562f3ade8f5c upstream.
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
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/i915_drv.h | 7 +++++++
drivers/gpu/drm/i915/i915_irq.c | 9 +++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1091,6 +1091,13 @@ typedef struct drm_i915_private {
unsigned int fsb_freq, mem_freq, is_ddr3;
+ /**
+ * wq - Driver workqueue for GEM.
+ *
+ * NOTE: Work items scheduled here are not allowed to grab any modeset
+ * locks, for otherwise the flushing done in the pageflip code will
+ * result in deadlocks.
+ */
struct workqueue_struct *wq;
/* Display functions */
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -910,8 +910,13 @@ static inline void intel_hpd_irq_handler
dev_priv->display.hpd_irq_setup(dev);
spin_unlock(&dev_priv->irq_lock);
- queue_work(dev_priv->wq,
- &dev_priv->hotplug_work);
+ /*
+ * Our hotplug handler can grab modeset locks (by calling down into the
+ * fb helpers). Hence it must not be run on our own dev-priv->wq work
+ * queue for otherwise the flush_work in the pageflip code will
+ * deadlock.
+ */
+ schedule_work(&dev_priv->hotplug_work);
}
static void gmbus_irq_handler(struct drm_device *dev)
next prev parent reply other threads:[~2013-09-29 19:27 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-29 19:27 [ 00/71] 3.11.3-stable review Greg Kroah-Hartman
2013-09-29 19:27 ` [ 01/71] PCI / ACPI / PM: Clear pme_poll for devices in D3cold on wakeup Greg Kroah-Hartman
2013-09-29 19:27 ` [ 02/71] ARM: OMAP4: Fix clock_get error for GPMC during boot Greg Kroah-Hartman
2013-09-29 19:27 ` [ 03/71] net: usb: cdc_ether: Use wwan interface for Telit modules Greg Kroah-Hartman
2013-09-29 19:27 ` [ 04/71] cifs: fix filp leak in cifs_atomic_open() Greg Kroah-Hartman
2013-09-29 19:27 ` [ 05/71] bgmac: fix internal switch initialization Greg Kroah-Hartman
2013-09-29 19:27 ` [ 06/71] rt2800: change initialization sequence to fix system freeze Greg Kroah-Hartman
2013-09-29 19:27 ` [ 07/71] rt2800: fix wrong TX power compensation Greg Kroah-Hartman
2013-09-29 19:27 ` [ 08/71] timekeeping: Fix HRTICK related deadlock from ntp lock changes Greg Kroah-Hartman
2013-09-29 19:27 ` [ 09/71] sched/cputime: Do not scale when utime == 0 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 10/71] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Greg Kroah-Hartman
2013-09-29 19:27 ` [ 11/71] HID: provide a helper for validating hid reports Greg Kroah-Hartman
2013-09-29 19:27 ` [ 12/71] HID: validate feature and input report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 13/71] HID: multitouch: validate indexes details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 14/71] HID: LG: validate HID output report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 15/71] HID: zeroplus: validate " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 16/71] HID: lenovo-tpkbd: fix leak if tpkbd_probe_tp fails Greg Kroah-Hartman
2013-09-29 19:27 ` [ 17/71] HID: steelseries: validate output report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 18/71] HID: sony: validate HID " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 19/71] HID: lenovo-tpkbd: validate " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 20/71] HID: logitech-dj: " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 21/71] usb: gadget: fix a bug and a WARN_ON in dummy-hcd Greg Kroah-Hartman
2013-09-29 19:27 ` [ 22/71] drm/i915: try not to lose backlight CBLV precision Greg Kroah-Hartman
2013-09-29 19:27 ` Greg Kroah-Hartman [this message]
2013-09-29 19:27 ` [ 24/71] drm/i915: fix gpu hang vs. flip stall deadlocks Greg Kroah-Hartman
2013-09-29 19:27 ` [ 25/71] drm/i915: fix wait_for_pending_flips vs gpu hang deadlock Greg Kroah-Hartman
2013-09-29 19:27 ` [ 26/71] drm/i915: do not update cursor in crtc mode set Greg Kroah-Hartman
2013-09-29 19:27 ` [ 27/71] drm/i915: Dont enable the cursor on a disable pipe Greg Kroah-Hartman
2013-09-29 19:27 ` [ 28/71] drm: fix DRM_IOCTL_MODE_GETFB handle-leak Greg Kroah-Hartman
2013-09-29 19:27 ` [ 29/71] drm/ast: fix the ast open key function Greg Kroah-Hartman
2013-09-29 19:27 ` [ 30/71] drm/ttm: fix the tt_populated check in ttm_tt_destroy() Greg Kroah-Hartman
2013-09-29 19:27 ` [ 31/71] radeon kms: fix uninitialised hotplug work usage in r100_irq_process() Greg Kroah-Hartman
2013-09-29 19:27 ` [ 32/71] drm/nv50/disp: prevent false output detection on the original nv50 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 33/71] drm/radeon: fix LCD record parsing Greg Kroah-Hartman
2013-09-29 19:27 ` [ 34/71] drm/radeon/dpm: add reclocking quirk for ASUS K70AF Greg Kroah-Hartman
2013-09-29 19:27 ` [ 35/71] drm/radeon: fix endian bugs in hw i2c atom routines Greg Kroah-Hartman
2013-09-29 19:27 ` [ 36/71] drm/radeon: enable UVD interrupts on CIK Greg Kroah-Hartman
2013-09-29 19:27 ` [ 37/71] drm/radeon: fill in gpu_init for berlin GPU cores Greg Kroah-Hartman
2013-09-29 19:27 ` [ 38/71] drm/radeon: update line buffer allocation for dce8 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 39/71] drm/radeon: fix init ordering for r600+ Greg Kroah-Hartman
2013-09-29 19:27 ` [ 40/71] drm/radeon/cik: update gpu_init for an additional berlin gpu Greg Kroah-Hartman
2013-09-29 19:27 ` [ 41/71] drm/radeon: add berlin pci ids Greg Kroah-Hartman
2013-09-29 19:27 ` [ 42/71] drm/radeon/si: Add support for CP DMA to CS checker for compute v2 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 43/71] drm/radeon: update line buffer allocation for dce4.1/5 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 44/71] drm/radeon: update line buffer allocation for dce6 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 45/71] drm/radeon: fix resume on some rs4xx boards (v2) Greg Kroah-Hartman
2013-09-29 19:27 ` [ 46/71] drm/radeon: fix handling of variable sized arrays for router objects Greg Kroah-Hartman
2013-09-29 19:27 ` [ 47/71] drm/radeon/dpm: make sure dc performance level limits are valid (BTC-SI) (v2) Greg Kroah-Hartman
2013-09-29 19:28 ` [ 48/71] tg3: Dont turn off led on 5719 serdes port 0 Greg Kroah-Hartman
2013-09-29 19:28 ` [ 49/71] tg3: Expand led off fix to include 5720 Greg Kroah-Hartman
2013-09-29 19:28 ` [ 50/71] drm/radeon: add some additional berlin pci ids Greg Kroah-Hartman
2013-09-29 19:28 ` [ 51/71] drm/radeon/r6xx: add a stubbed out set_uvd_clocks callback Greg Kroah-Hartman
2013-09-29 19:28 ` [ 52/71] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Greg Kroah-Hartman
2013-09-29 19:28 ` [ 53/71] drm/radeon/dpm: handle bapm on trinity Greg Kroah-Hartman
2013-09-29 19:28 ` [ 54/71] drm/radeon/dpm: fix fallback for empty UVD clocks Greg Kroah-Hartman
2013-09-29 19:28 ` [ 55/71] drm/radeon/dpm/rs780: dont enable sclk scaling if not required Greg Kroah-Hartman
2013-09-29 19:28 ` [ 56/71] drm/radeon: fix panel scaling with eDP and LVDS bridges Greg Kroah-Hartman
2013-09-29 19:28 ` [ 57/71] drm/radeon: avoid UVD corruptions on AGP cards Greg Kroah-Hartman
2013-09-29 19:28 ` [ 58/71] skge: fix broken driver Greg Kroah-Hartman
2013-09-29 19:28 ` [ 59/71] udf: Standardize return values in mount sequence Greg Kroah-Hartman
2013-09-29 19:28 ` [ 60/71] udf: Refuse RW mount of the filesystem instead of making it RO Greg Kroah-Hartman
2013-09-29 19:28 ` [ 61/71] audit: fix endless wait in audit_log_start() Greg Kroah-Hartman
2013-09-29 19:28 ` [ 62/71] mm: fix aio performance regression for database caused by THP Greg Kroah-Hartman
2013-09-29 19:28 ` [ 63/71] bio-integrity: Fix use of bs->bio_integrity_pool after free Greg Kroah-Hartman
2013-09-29 19:28 ` [ 64/71] cfq: explicitly use 64bit divide operation for 64bit arguments Greg Kroah-Hartman
2013-09-29 19:28 ` [ 65/71] rpc: clean up decoding of gssproxy linux creds Greg Kroah-Hartman
2013-09-29 19:28 ` [ 66/71] rpc: comment on linux_cred encoding, treat all as unsigned Greg Kroah-Hartman
2013-09-29 19:28 ` [ 67/71] rpc: fix huge kmallocs in gss-proxy Greg Kroah-Hartman
2013-09-29 19:28 ` [ 68/71] rpc: let xdr layer allocate gssproxy receieve pages Greg Kroah-Hartman
2013-09-29 19:28 ` [ 69/71] cw1200: Prevent a lock-related hang in the cw1200_spi driver Greg Kroah-Hartman
2013-09-29 19:28 ` [ 70/71] cw1200: Dont perform SPI transfers in interrupt context Greg Kroah-Hartman
2013-10-02 2:23 ` Solomon Peachy
2013-10-02 21:26 ` Greg Kroah-Hartman
2013-10-03 13:22 ` Solomon Peachy
2013-09-29 19:28 ` [ 71/71] netfilter: ipset: Fix serious failure in CIDR tracking Greg Kroah-Hartman
2013-09-30 1:28 ` [ 00/71] 3.11.3-stable review Guenter Roeck
2013-09-30 1:51 ` Greg Kroah-Hartman
2013-09-30 2:22 ` Guenter Roeck
2013-10-01 19:23 ` Shuah Khan
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=20130929192645.106139871@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=sabercrombie@chromium.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).