Bluetooth: hci_vhci: Report write readiness with queued input
vhci_poll() returns only EPOLLIN and EPOLLRDNORM when readq is nonempty,
dropping the write readiness bits it reports when the queue is empty.
However, vhci_write() does not wait for readq to drain: incoming frames
are handled independently by vhci_get_user().
As a result, userspace polling only for write readiness can time out or
remain asleep while input is queued, even though it could submit a
frame. Applications that drain input before waiting to write avoid this
case.
Always include EPOLLOUT and EPOLLWRNORM in the readiness mask, and add
EPOLLIN and EPOLLRDNORM when readq contains data. Keep the existing wait
queue registration and empty-queue behavior unchanged.
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 file changed