Skip to content

Commit

Permalink
[media] cec: poll should check if there is room in the tx queue
Browse files Browse the repository at this point in the history
For POLLOUT poll only checked if the adapter was configured, not
if there was room in the transmit queue. Add that check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 19, 2016
1 parent 8350502 commit b7cbc89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/media/cec/cec-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ static unsigned int cec_poll(struct file *filp,
if (!devnode->registered)
return POLLERR | POLLHUP;
mutex_lock(&adap->lock);
if (adap->is_configured)
if (adap->is_configured &&
adap->transmit_queue_sz < CEC_MAX_MSG_TX_QUEUE_SZ)
res |= POLLOUT | POLLWRNORM;
if (fh->queued_msgs)
res |= POLLIN | POLLRDNORM;
Expand Down

0 comments on commit b7cbc89

Please sign in to comment.