summaryrefslogtreecommitdiffstats
path: root/drivers/tty/hvc/virtio_console.c
diff options
context:
space:
mode:
authorAmit Shah2011-01-31 08:36:36 +0100
committerRusty Russell2011-02-08 22:49:53 +0100
commit2770c5ea501be69989a7acf54ec4cb3554c47191 (patch)
tree47c637a8e1dd803b6df7bd34ab30ea9a8f805a18 /drivers/tty/hvc/virtio_console.c
parentMerge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze (diff)
downloadkernel-qcow2-linux-2770c5ea501be69989a7acf54ec4cb3554c47191.tar.gz
kernel-qcow2-linux-2770c5ea501be69989a7acf54ec4cb3554c47191.tar.xz
kernel-qcow2-linux-2770c5ea501be69989a7acf54ec4cb3554c47191.zip
virtio: console: Wake up outvq on host notifications
The outvq needs to be woken up on host notifications so that buffers consumed by the host can be reclaimed, outvq freed, and application writes may proceed again. The need for this is now finally noticed when I have qemu patches ready to use nonblocking IO and flow control. CC: Hans de Goede <hdegoede@redhat.com> CC: stable@kernel.org Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/tty/hvc/virtio_console.c')
-rw-r--r--drivers/tty/hvc/virtio_console.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/tty/hvc/virtio_console.c b/drivers/tty/hvc/virtio_console.c
index 896a2ced1d27..ad2520b1e03f 100644
--- a/drivers/tty/hvc/virtio_console.c
+++ b/drivers/tty/hvc/virtio_console.c
@@ -1462,6 +1462,17 @@ static void control_work_handler(struct work_struct *work)
spin_unlock(&portdev->cvq_lock);
}
+static void out_intr(struct virtqueue *vq)
+{
+ struct port *port;
+
+ port = find_port_by_vq(vq->vdev->priv, vq);
+ if (!port)
+ return;
+
+ wake_up_interruptible(&port->waitqueue);
+}
+
static void in_intr(struct virtqueue *vq)
{
struct port *port;
@@ -1566,7 +1577,7 @@ static int init_vqs(struct ports_device *portdev)
*/
j = 0;
io_callbacks[j] = in_intr;
- io_callbacks[j + 1] = NULL;
+ io_callbacks[j + 1] = out_intr;
io_names[j] = "input";
io_names[j + 1] = "output";
j += 2;
@@ -1580,7 +1591,7 @@ static int init_vqs(struct ports_device *portdev)
for (i = 1; i < nr_ports; i++) {
j += 2;
io_callbacks[j] = in_intr;
- io_callbacks[j + 1] = NULL;
+ io_callbacks[j + 1] = out_intr;
io_names[j] = "input";
io_names[j + 1] = "output";
}