提交 f4dd471b 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

media: media-request: fix epoll() by calling poll_wait first

The epoll function expects that whenever the poll file op is
called, the poll_wait function is also called. That didn't
always happen in media_request_poll(). Fix this, otherwise
epoll() would timeout when it shouldn't.
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 b7990bcf
...@@ -100,6 +100,7 @@ static __poll_t media_request_poll(struct file *filp, ...@@ -100,6 +100,7 @@ static __poll_t media_request_poll(struct file *filp,
if (!(poll_requested_events(wait) & EPOLLPRI)) if (!(poll_requested_events(wait) & EPOLLPRI))
return 0; return 0;
poll_wait(filp, &req->poll_wait, wait);
spin_lock_irqsave(&req->lock, flags); spin_lock_irqsave(&req->lock, flags);
if (req->state == MEDIA_REQUEST_STATE_COMPLETE) { if (req->state == MEDIA_REQUEST_STATE_COMPLETE) {
ret = EPOLLPRI; ret = EPOLLPRI;
...@@ -110,8 +111,6 @@ static __poll_t media_request_poll(struct file *filp, ...@@ -110,8 +111,6 @@ static __poll_t media_request_poll(struct file *filp,
goto unlock; goto unlock;
} }
poll_wait(filp, &req->poll_wait, wait);
unlock: unlock:
spin_unlock_irqrestore(&req->lock, flags); spin_unlock_irqrestore(&req->lock, flags);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册