aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 17:14:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 17:14:04 -0400
commit736a2dd2571ac56b11ed95a7814d838d5311be04 (patch)
treede10d107025970c6e51d5b6faeba799ed4b9caae /drivers/char/virtio_console.c
parent0b2e3b6bb4a415379f16e38fc92db42379be47a1 (diff)
parent01d779a14ef800b74684d9692add4944df052461 (diff)
Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio & lguest updates from Rusty Russell: "Lots of virtio work which wasn't quite ready for last merge window. Plus I dived into lguest again, reworking the pagetable code so we can move the switcher page: our fixmaps sometimes take more than 2MB now..." Ugh. Annoying conflicts with the tcm_vhost -> vhost_scsi rename. Hopefully correctly resolved. * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (57 commits) caif_virtio: Remove bouncing email addresses lguest: improve code readability in lg_cpu_start. virtio-net: fill only rx queues which are being used lguest: map Switcher below fixmap. lguest: cache last cpu we ran on. lguest: map Switcher text whenever we allocate a new pagetable. lguest: don't share Switcher PTE pages between guests. lguest: expost switcher_pages array (as lg_switcher_pages). lguest: extract shadow PTE walking / allocating. lguest: make check_gpte et. al return bool. lguest: assume Switcher text is a single page. lguest: rename switcher_page to switcher_pages. lguest: remove RESERVE_MEM constant. lguest: check vaddr not pgd for Switcher protection. lguest: prepare to make SWITCHER_ADDR a variable. virtio: console: replace EMFILE with EBUSY for already-open port virtio-scsi: reset virtqueue affinity when doing cpu hotplug virtio-scsi: introduce multiqueue support virtio-scsi: push vq lock/unlock into virtscsi_vq_done virtio-scsi: pass struct virtio_scsi to virtqueue completion function ...
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index ce5f3fc25d6d..1b456fe9b87a 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -78,8 +78,8 @@ struct ports_driver_data {
78}; 78};
79static struct ports_driver_data pdrvdata; 79static struct ports_driver_data pdrvdata;
80 80
81DEFINE_SPINLOCK(pdrvdata_lock); 81static DEFINE_SPINLOCK(pdrvdata_lock);
82DECLARE_COMPLETION(early_console_added); 82static DECLARE_COMPLETION(early_console_added);
83 83
84/* This struct holds information that's relevant only for console ports */ 84/* This struct holds information that's relevant only for console ports */
85struct console { 85struct console {
@@ -503,7 +503,7 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf)
503 503
504 sg_init_one(sg, buf->buf, buf->size); 504 sg_init_one(sg, buf->buf, buf->size);
505 505
506 ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC); 506 ret = virtqueue_add_inbuf(vq, sg, 1, buf, GFP_ATOMIC);
507 virtqueue_kick(vq); 507 virtqueue_kick(vq);
508 if (!ret) 508 if (!ret)
509 ret = vq->num_free; 509 ret = vq->num_free;
@@ -572,7 +572,7 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
572 sg_init_one(sg, &cpkt, sizeof(cpkt)); 572 sg_init_one(sg, &cpkt, sizeof(cpkt));
573 573
574 spin_lock(&portdev->c_ovq_lock); 574 spin_lock(&portdev->c_ovq_lock);
575 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) == 0) { 575 if (virtqueue_add_outbuf(vq, sg, 1, &cpkt, GFP_ATOMIC) == 0) {
576 virtqueue_kick(vq); 576 virtqueue_kick(vq);
577 while (!virtqueue_get_buf(vq, &len)) 577 while (!virtqueue_get_buf(vq, &len))
578 cpu_relax(); 578 cpu_relax();
@@ -622,7 +622,7 @@ static ssize_t __send_to_port(struct port *port, struct scatterlist *sg,
622 622
623 reclaim_consumed_buffers(port); 623 reclaim_consumed_buffers(port);
624 624
625 err = virtqueue_add_buf(out_vq, sg, nents, 0, data, GFP_ATOMIC); 625 err = virtqueue_add_outbuf(out_vq, sg, nents, data, GFP_ATOMIC);
626 626
627 /* Tell Host to go! */ 627 /* Tell Host to go! */
628 virtqueue_kick(out_vq); 628 virtqueue_kick(out_vq);
@@ -1040,7 +1040,7 @@ static int port_fops_open(struct inode *inode, struct file *filp)
1040 spin_lock_irq(&port->inbuf_lock); 1040 spin_lock_irq(&port->inbuf_lock);
1041 if (port->guest_connected) { 1041 if (port->guest_connected) {
1042 spin_unlock_irq(&port->inbuf_lock); 1042 spin_unlock_irq(&port->inbuf_lock);
1043 ret = -EMFILE; 1043 ret = -EBUSY;
1044 goto out; 1044 goto out;
1045 } 1045 }
1046 1046
@@ -1202,7 +1202,7 @@ int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int))
1202 return hvc_instantiate(0, 0, &hv_ops); 1202 return hvc_instantiate(0, 0, &hv_ops);
1203} 1203}
1204 1204
1205int init_port_console(struct port *port) 1205static int init_port_console(struct port *port)
1206{ 1206{
1207 int ret; 1207 int ret;
1208 1208