From 005b20a8e0f587a46a00910ba4507bb9f6da70ea Mon Sep 17 00:00:00 2001 From: Krishna Kumar Date: Wed, 5 Oct 2011 11:08:59 +0530 Subject: virtio: Dont add "config" to list for !per_vq_vector For the MSI but non-per_vq_vector case, the config/change vq also gets added to the list of vqs that need to process the MSI interrupt. This is not needed as config has it's own handler (vp_config_changed). In any case, vring_interrupt() finds nothing needs to be done on this vq. I tested this patch by testing the "Fallback:" and "Finally fall back" cases in vp_find_vqs(). Please review. Signed-off-by: Krishna Kumar Acked-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/virtio') diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 4bcc8b82640..79a31e5b4b6 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -415,9 +415,13 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, } } - spin_lock_irqsave(&vp_dev->lock, flags); - list_add(&info->node, &vp_dev->virtqueues); - spin_unlock_irqrestore(&vp_dev->lock, flags); + if (callback) { + spin_lock_irqsave(&vp_dev->lock, flags); + list_add(&info->node, &vp_dev->virtqueues); + spin_unlock_irqrestore(&vp_dev->lock, flags); + } else { + INIT_LIST_HEAD(&info->node); + } return vq; -- cgit v1.2.3