mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-24 04:30:23 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: virtio: order used ring after used index read virtio-pci: fix per-vq MSI-X request logic
This commit is contained in:
commit
add810a1c5
@ -530,19 +530,22 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
|
|||||||
err = PTR_ERR(vqs[i]);
|
err = PTR_ERR(vqs[i]);
|
||||||
goto error_find;
|
goto error_find;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!vp_dev->per_vq_vectors || msix_vec == VIRTIO_MSI_NO_VECTOR)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* allocate per-vq irq if available and necessary */
|
/* allocate per-vq irq if available and necessary */
|
||||||
if (vp_dev->per_vq_vectors) {
|
snprintf(vp_dev->msix_names[msix_vec],
|
||||||
snprintf(vp_dev->msix_names[msix_vec],
|
sizeof *vp_dev->msix_names,
|
||||||
sizeof *vp_dev->msix_names,
|
"%s-%s",
|
||||||
"%s-%s",
|
dev_name(&vp_dev->vdev.dev), names[i]);
|
||||||
dev_name(&vp_dev->vdev.dev), names[i]);
|
err = request_irq(vp_dev->msix_entries[msix_vec].vector,
|
||||||
err = request_irq(msix_vec, vring_interrupt, 0,
|
vring_interrupt, 0,
|
||||||
vp_dev->msix_names[msix_vec],
|
vp_dev->msix_names[msix_vec],
|
||||||
vqs[i]);
|
vqs[i]);
|
||||||
if (err) {
|
if (err) {
|
||||||
vp_del_vq(vqs[i]);
|
vp_del_vq(vqs[i]);
|
||||||
goto error_find;
|
goto error_find;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -285,6 +285,9 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only get used array entries after they have been exposed by host. */
|
||||||
|
rmb();
|
||||||
|
|
||||||
i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
|
i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
|
||||||
*len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;
|
*len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user