]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] cec: poll should check if there is room in the tx queue
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 17 Jul 2016 16:02:44 +0000 (13:02 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 19 Jul 2016 16:27:10 +0000 (13:27 -0300)
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>
drivers/staging/media/cec/cec-api.c

index 559f6500d114f1370199dc52b4bef0fae6b916fc..7be7615a0fdf0e865b3d0433d731f8d1089efe0d 100644 (file)
@@ -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;