From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Virtualization List <virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH v2 1/2] virtio: console: rename cvq_lock to c_ivq_lock
Date: Fri, 29 Mar 2013 19:04:57 +0800 [thread overview]
Message-ID: <51557559.8030103@cn.fujitsu.com> (raw)
In-Reply-To: <31670e919527c1594c2fbab64c7a398a5f673086.1364554596.git.amit.shah@redhat.com>
On 03/29/2013 07:00 PM, Amit Shah wrote:
> 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: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---
> drivers/char/virtio_console.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index e905d5f..7e9bc1d 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -149,7 +149,7 @@ struct ports_device {
> spinlock_t ports_lock;
>
> /* To protect the vq operations for the control channel */
> - spinlock_t cvq_lock;
> + spinlock_t c_ivq_lock;
>
> /* The current config space is stored here */
> struct virtio_console_config config;
> @@ -1709,23 +1709,23 @@ static void control_work_handler(struct work_struct *work)
> portdev = container_of(work, struct ports_device, control_work);
> vq = portdev->c_ivq;
>
> - spin_lock(&portdev->cvq_lock);
> + spin_lock(&portdev->c_ivq_lock);
> while ((buf = virtqueue_get_buf(vq, &len))) {
> - spin_unlock(&portdev->cvq_lock);
> + spin_unlock(&portdev->c_ivq_lock);
>
> buf->len = len;
> buf->offset = 0;
>
> handle_control_message(portdev, buf);
>
> - spin_lock(&portdev->cvq_lock);
> + spin_lock(&portdev->c_ivq_lock);
> if (add_inbuf(portdev->c_ivq, buf) < 0) {
> dev_warn(&portdev->vdev->dev,
> "Error adding buffer to queue\n");
> free_buf(buf, false);
> }
> }
> - spin_unlock(&portdev->cvq_lock);
> + spin_unlock(&portdev->c_ivq_lock);
> }
>
> static void out_intr(struct virtqueue *vq)
> @@ -1986,10 +1986,11 @@ static int virtcons_probe(struct virtio_device *vdev)
> if (multiport) {
> unsigned int nr_added_bufs;
>
> - spin_lock_init(&portdev->cvq_lock);
> + spin_lock_init(&portdev->c_ivq_lock);
> INIT_WORK(&portdev->control_work, &control_work_handler);
>
> - nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock);
> + nr_added_bufs = fill_queue(portdev->c_ivq,
> + &portdev->c_ivq_lock);
> if (!nr_added_bufs) {
> dev_err(&vdev->dev,
> "Error allocating buffers for control queue\n");
> @@ -2140,7 +2141,7 @@ static int virtcons_restore(struct virtio_device *vdev)
> return ret;
>
> if (use_multiport(portdev))
> - fill_queue(portdev->c_ivq, &portdev->cvq_lock);
> + fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
>
> list_for_each_entry(port, &portdev->ports, list) {
> port->in_vq = portdev->in_vqs[port->id];
>
next prev parent reply other threads:[~2013-03-29 11:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-29 11:00 [PATCH v2 0/2] virtio: console: add locking around control out-vq Amit Shah
2013-03-29 11:00 ` [PATCH v2 1/2] virtio: console: rename cvq_lock to c_ivq_lock Amit Shah
2013-03-29 11:04 ` Wanlong Gao [this message]
2013-03-29 11:00 ` [PATCH v2 2/2] virtio: console: add locking around c_ovq operations Amit Shah
2013-03-29 11:05 ` Wanlong Gao
2013-03-30 3:58 ` Rusty Russell
2013-04-02 5:26 ` Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51557559.8030103@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=amit.shah@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.