summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-08-04 09:23:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:45:23 -0700
commitd5b0f9cb6affcb00750662564445c4741a934fba (patch)
tree36267ccca7d74018d6808fe4228f35b81a5fa3c9
parent75cd835d69ac31c47861b08aa8cc89b6b2531a60 (diff)
downloadlinux-stable-d5b0f9cb6affcb00750662564445c4741a934fba.tar.gz
linux-stable-d5b0f9cb6affcb00750662564445c4741a934fba.tar.bz2
linux-stable-d5b0f9cb6affcb00750662564445c4741a934fba.zip
drm: Wake up next in drm_read() chain if we are forced to putback the event
[ Upstream commit 60b801999c48b6c1dd04e653a38e2e613664264e ] After an event is sent, we try to copy it into the user buffer of the first waiter in drm_read() and if the user buffer doesn't have enough room we put it back onto the list. However, we didn't wake up any subsequent waiter, so that event may sit on the list until either a new vblank event is sent or a new waiter appears. Rare, but in the worst case may lead to a stuck process. Testcase: igt/drm_read/short-buffer-wakeup Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170804082328.17173-1-chris@chris-wilson.co.uk Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/drm_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 3f20f598cd7c..9c5bc0121ff9 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -567,6 +567,7 @@ put_back_event:
file_priv->event_space -= length;
list_add(&e->link, &file_priv->event_list);
spin_unlock_irq(&dev->event_lock);
+ wake_up_interruptible(&file_priv->event_wait);
break;
}