From: Amit Shah Date: Wed, 14 Sep 2011 07:36:41 +0000 (+0530) Subject: virtio: console: Use wait_event_freezable instead of _interruptible X-Git-Tag: next-20110915~47^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4d4ecdb9bfe6bc54fa2cdc3142f826a74b78494a;p=karo-tx-linux.git virtio: console: Use wait_event_freezable instead of _interruptible Get ready to support suspend/resume by using the freezable calls so that blocking read/write syscalls are handled properly across suspend/resume. Signed-off-by: Amit Shah Signed-off-by: Rusty Russell --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 5397884b6c02..8f49d0f034e0 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -633,8 +634,8 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, if (filp->f_flags & O_NONBLOCK) return -EAGAIN; - ret = wait_event_interruptible(port->waitqueue, - !will_read_block(port)); + ret = wait_event_freezable(port->waitqueue, + !will_read_block(port)); if (ret < 0) return ret; } @@ -677,8 +678,8 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, if (nonblock) return -EAGAIN; - ret = wait_event_interruptible(port->waitqueue, - !will_write_block(port)); + ret = wait_event_freezable(port->waitqueue, + !will_write_block(port)); if (ret < 0) return ret; }