From: Fabian Henneke Date: Tue, 9 Jul 2019 11:03:37 +0000 (+0200) Subject: hidraw: Return EPOLLOUT from hidraw_poll X-Git-Tag: for-linus-2019-09-27~26^2~5^2~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=378b80370aa1;p=linux-block.git hidraw: Return EPOLLOUT from hidraw_poll Always return EPOLLOUT from hidraw_poll when a device is connected. This is safe since writes are always possible (but will always block). hidraw does not support non-blocking writes and instead always calls blocking backend functions on write requests. Hence, so far, a call to poll never returned EPOLLOUT, which confuses tools like socat. Signed-off-by: Fabian Henneke In-reply-to: Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 006bd6f4f653..24f40a3ddded 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -252,7 +252,7 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait) poll_wait(file, &list->hidraw->wait, wait); if (list->head != list->tail) - return EPOLLIN | EPOLLRDNORM; + return EPOLLIN | EPOLLRDNORM | EPOLLOUT; if (!list->hidraw->exist) return EPOLLERR | EPOLLHUP; return 0;