diff options
Diffstat (limited to 'drivers/gpu/drm/msm/msm_rd.c')
| -rw-r--r-- | drivers/gpu/drm/msm/msm_rd.c | 7 |
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) | |||
| 115 | char *fptr = &fifo->buf[fifo->head]; | 115 | char *fptr = &fifo->buf[fifo->head]; |
| 116 | int n; | 116 | int n; |
| 117 | 117 | ||
| 118 | wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0); | 118 | wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open); |
| 119 | if (!rd->open) | ||
| 120 | return; | ||
| 119 | 121 | ||
| 120 | /* Note that smp_load_acquire() is not strictly required | 122 | /* Note that smp_load_acquire() is not strictly required |
| 121 | * as CIRC_SPACE_TO_END() does not access the tail more | 123 | * as CIRC_SPACE_TO_END() does not access the tail more |
| @@ -213,7 +215,10 @@ out: | |||
| 213 | static int rd_release(struct inode *inode, struct file *file) | 215 | static int rd_release(struct inode *inode, struct file *file) |
| 214 | { | 216 | { |
| 215 | struct msm_rd_state *rd = inode->i_private; | 217 | struct msm_rd_state *rd = inode->i_private; |
| 218 | |||
| 216 | rd->open = false; | 219 | rd->open = false; |
| 220 | wake_up_all(&rd->fifo_event); | ||
| 221 | |||
| 217 | return 0; | 222 | return 0; |
| 218 | } | 223 | } |
| 219 | 224 | ||
