projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3709ea7
)
virtio: console: Unblock poll on port hot-unplug
author
Amit Shah
<amit.shah@redhat.com>
Thu, 2 Sep 2010 12:41:44 +0000
(18:11 +0530)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 21 Oct 2010 07:14:01 +0000
(17:44 +1030)
When a port is hot-unplugged while an app is blocked on poll(), unblock
the poll() and return.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/char/virtio_console.c
b/drivers/char/virtio_console.c
index 92f1f65d57a923c338d117f036af30f0af054963..47b710ca4ab3320d1c4b7bea9fdb1af33df48984 100644
(file)
--- a/
drivers/char/virtio_console.c
+++ b/
drivers/char/virtio_console.c
@@
-663,6
+663,10
@@
static unsigned int port_fops_poll(struct file *filp, poll_table *wait)
port = filp->private_data;
poll_wait(filp, &port->waitqueue, wait);
+ if (!port->guest_connected) {
+ /* Port got unplugged */
+ return POLLHUP;
+ }
ret = 0;
if (!will_read_block(port))
ret |= POLLIN | POLLRDNORM;