aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2013-03-29 07:00:07 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-03-29 23:53:48 -0400
commit165b1b8bbc17c9469b053bab78b11b7cbce6d161 (patch)
tree721b3fd4a61e093ab35d549affeca2e20e187f96 /drivers/char
parentb7d44d9487a11e835de10908f4ab30b4290c0b7f (diff)
virtio: console: rename cvq_lock to c_ivq_lock
The cvq_lock was taken for the c_ivq. Rename the lock to make that obvious. We'll also add a lock around the c_ovq in the next commit, so there's no ambiguity. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Asias He <asias@redhat.com> Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: stable@kernel.org
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index e6ba6b7887e9..2dd9134faa27 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -149,7 +149,7 @@ struct ports_device {
149 spinlock_t ports_lock; 149 spinlock_t ports_lock;
150 150
151 /* To protect the vq operations for the control channel */ 151 /* To protect the vq operations for the control channel */
152 spinlock_t cvq_lock; 152 spinlock_t c_ivq_lock;
153 153
154 /* The current config space is stored here */ 154 /* The current config space is stored here */
155 struct virtio_console_config config; 155 struct virtio_console_config config;
@@ -1709,23 +1709,23 @@ static void control_work_handler(struct work_struct *work)
1709 portdev = container_of(work, struct ports_device, control_work); 1709 portdev = container_of(work, struct ports_device, control_work);
1710 vq = portdev->c_ivq; 1710 vq = portdev->c_ivq;
1711 1711
1712 spin_lock(&portdev->cvq_lock); 1712 spin_lock(&portdev->c_ivq_lock);
1713 while ((buf = virtqueue_get_buf(vq, &len))) { 1713 while ((buf = virtqueue_get_buf(vq, &len))) {
1714 spin_unlock(&portdev->cvq_lock); 1714 spin_unlock(&portdev->c_ivq_lock);
1715 1715
1716 buf->len = len; 1716 buf->len = len;
1717 buf->offset = 0; 1717 buf->offset = 0;
1718 1718
1719 handle_control_message(portdev, buf); 1719 handle_control_message(portdev, buf);
1720 1720
1721 spin_lock(&portdev->cvq_lock); 1721 spin_lock(&portdev->c_ivq_lock);
1722 if (add_inbuf(portdev->c_ivq, buf) < 0) { 1722 if (add_inbuf(portdev->c_ivq, buf) < 0) {
1723 dev_warn(&portdev->vdev->dev, 1723 dev_warn(&portdev->vdev->dev,
1724 "Error adding buffer to queue\n"); 1724 "Error adding buffer to queue\n");
1725 free_buf(buf, false); 1725 free_buf(buf, false);
1726 } 1726 }
1727 } 1727 }
1728 spin_unlock(&portdev->cvq_lock); 1728 spin_unlock(&portdev->c_ivq_lock);
1729} 1729}
1730 1730
1731static void out_intr(struct virtqueue *vq) 1731static void out_intr(struct virtqueue *vq)
@@ -1996,10 +1996,11 @@ static int virtcons_probe(struct virtio_device *vdev)
1996 if (multiport) { 1996 if (multiport) {
1997 unsigned int nr_added_bufs; 1997 unsigned int nr_added_bufs;
1998 1998
1999 spin_lock_init(&portdev->cvq_lock); 1999 spin_lock_init(&portdev->c_ivq_lock);
2000 INIT_WORK(&portdev->control_work, &control_work_handler); 2000 INIT_WORK(&portdev->control_work, &control_work_handler);
2001 2001
2002 nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock); 2002 nr_added_bufs = fill_queue(portdev->c_ivq,
2003 &portdev->c_ivq_lock);
2003 if (!nr_added_bufs) { 2004 if (!nr_added_bufs) {
2004 dev_err(&vdev->dev, 2005 dev_err(&vdev->dev,
2005 "Error allocating buffers for control queue\n"); 2006 "Error allocating buffers for control queue\n");
@@ -2150,7 +2151,7 @@ static int virtcons_restore(struct virtio_device *vdev)
2150 return ret; 2151 return ret;
2151 2152
2152 if (use_multiport(portdev)) 2153 if (use_multiport(portdev))
2153 fill_queue(portdev->c_ivq, &portdev->cvq_lock); 2154 fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
2154 2155
2155 list_for_each_entry(port, &portdev->ports, list) { 2156 list_for_each_entry(port, &portdev->ports, list) {
2156 port->in_vq = portdev->in_vqs[port->id]; 2157 port->in_vq = portdev->in_vqs[port->id];