Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362089
b: refs/heads/master
c: 9ba5c80
h: refs/heads/master
i:
  362087: 6b4a404
v: v3
  • Loading branch information
Amit Shah authored and Rusty Russell committed Mar 30, 2013
1 parent 251407c commit 62e970e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 165b1b8bbc17c9469b053bab78b11b7cbce6d161
refs/heads/master: 9ba5c80b1aea8648a3efe5f22dc1f7cacdfbeeb8
5 changes: 5 additions & 0 deletions trunk/drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ struct ports_device {

/* To protect the vq operations for the control channel */
spinlock_t c_ivq_lock;
spinlock_t c_ovq_lock;

/* The current config space is stored here */
struct virtio_console_config config;
Expand Down Expand Up @@ -569,11 +570,14 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
vq = portdev->c_ovq;

sg_init_one(sg, &cpkt, sizeof(cpkt));

spin_lock(&portdev->c_ovq_lock);
if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) == 0) {
virtqueue_kick(vq);
while (!virtqueue_get_buf(vq, &len))
cpu_relax();
}
spin_unlock(&portdev->c_ovq_lock);
return 0;
}

Expand Down Expand Up @@ -1997,6 +2001,7 @@ static int virtcons_probe(struct virtio_device *vdev)
unsigned int nr_added_bufs;

spin_lock_init(&portdev->c_ivq_lock);
spin_lock_init(&portdev->c_ovq_lock);
INIT_WORK(&portdev->control_work, &control_work_handler);

nr_added_bufs = fill_queue(portdev->c_ivq,
Expand Down

0 comments on commit 62e970e

Please sign in to comment.