aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2011-09-14 03:36:41 -0400
committerRusty Russell <rusty@rustcorp.com.au>2011-11-01 21:11:00 -0400
commita08fa92d16f2fa112e3400c6c513d23ae78b960a (patch)
tree045c57551c2193a6d387231938e7426eaa450faf /drivers/char/virtio_console.c
parent291024ef351328e7b4ca6bae798abc816a43653c (diff)
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 <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c9
1 files changed, 5 insertions, 4 deletions
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 @@
21#include <linux/debugfs.h> 21#include <linux/debugfs.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/freezer.h>
24#include <linux/fs.h> 25#include <linux/fs.h>
25#include <linux/init.h> 26#include <linux/init.h>
26#include <linux/list.h> 27#include <linux/list.h>
@@ -633,8 +634,8 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
633 if (filp->f_flags & O_NONBLOCK) 634 if (filp->f_flags & O_NONBLOCK)
634 return -EAGAIN; 635 return -EAGAIN;
635 636
636 ret = wait_event_interruptible(port->waitqueue, 637 ret = wait_event_freezable(port->waitqueue,
637 !will_read_block(port)); 638 !will_read_block(port));
638 if (ret < 0) 639 if (ret < 0)
639 return ret; 640 return ret;
640 } 641 }
@@ -677,8 +678,8 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
677 if (nonblock) 678 if (nonblock)
678 return -EAGAIN; 679 return -EAGAIN;
679 680
680 ret = wait_event_interruptible(port->waitqueue, 681 ret = wait_event_freezable(port->waitqueue,
681 !will_write_block(port)); 682 !will_write_block(port));
682 if (ret < 0) 683 if (ret < 0)
683 return ret; 684 return ret;
684 } 685 }