diff options
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
-rw-r--r-- | drivers/virtio/virtio_pci.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 4a1f1ebff7bf..28d9cf7cf72f 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
@@ -530,19 +530,22 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, | |||
530 | err = PTR_ERR(vqs[i]); | 530 | err = PTR_ERR(vqs[i]); |
531 | goto error_find; | 531 | goto error_find; |
532 | } | 532 | } |
533 | |||
534 | if (!vp_dev->per_vq_vectors || msix_vec == VIRTIO_MSI_NO_VECTOR) | ||
535 | continue; | ||
536 | |||
533 | /* allocate per-vq irq if available and necessary */ | 537 | /* allocate per-vq irq if available and necessary */ |
534 | if (vp_dev->per_vq_vectors) { | 538 | snprintf(vp_dev->msix_names[msix_vec], |
535 | snprintf(vp_dev->msix_names[msix_vec], | 539 | sizeof *vp_dev->msix_names, |
536 | sizeof *vp_dev->msix_names, | 540 | "%s-%s", |
537 | "%s-%s", | 541 | dev_name(&vp_dev->vdev.dev), names[i]); |
538 | dev_name(&vp_dev->vdev.dev), names[i]); | 542 | err = request_irq(vp_dev->msix_entries[msix_vec].vector, |
539 | err = request_irq(msix_vec, vring_interrupt, 0, | 543 | vring_interrupt, 0, |
540 | vp_dev->msix_names[msix_vec], | 544 | vp_dev->msix_names[msix_vec], |
541 | vqs[i]); | 545 | vqs[i]); |
542 | if (err) { | 546 | if (err) { |
543 | vp_del_vq(vqs[i]); | 547 | vp_del_vq(vqs[i]); |
544 | goto error_find; | 548 | goto error_find; |
545 | } | ||
546 | } | 549 | } |
547 | } | 550 | } |
548 | return 0; | 551 | return 0; |