summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_rd.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-02-11 11:17:23 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-02-11 11:17:23 +0300
commite65372124cd749ebbe4ac2abe5a511d7d1ac68db (patch)
tree1f9fd7cec6ffba19c76fff1e82c562fa1adae5da /drivers/gpu/drm/msm/msm_rd.c
parenta3240f09307ac978270d423b542f229e2ccc07b8 (diff)
parentd13937116f1e82bf508a6325111b322c30c85eb9 (diff)
downloadlinux-e65372124cd749ebbe4ac2abe5a511d7d1ac68db.tar.xz
Merge tag 'v5.0-rc6' into devel
Linux 5.0-rc6
Diffstat (limited to 'drivers/gpu/drm/msm/msm_rd.c')
-rw-r--r--drivers/gpu/drm/msm/msm_rd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
index 90e9d0a48dc0..d21172933d92 100644
--- a/drivers/gpu/drm/msm/msm_rd.c
+++ b/drivers/gpu/drm/msm/msm_rd.c
@@ -115,7 +115,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
char *fptr = &fifo->buf[fifo->head];
int n;
- wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
+ wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
+ if (!rd->open)
+ return;
/* Note that smp_load_acquire() is not strictly required
* as CIRC_SPACE_TO_END() does not access the tail more
@@ -213,7 +215,10 @@ out:
static int rd_release(struct inode *inode, struct file *file)
{
struct msm_rd_state *rd = inode->i_private;
+
rd->open = false;
+ wake_up_all(&rd->fifo_event);
+
return 0;
}