Revert "virtio: Protect vqs list access"
This reverts commit b9a59636c4
which is
commit 0e566c8f0f2e8325e35f6f97e13cde5356b41814 upstream.
This breaks the Android kernel ABI, and this is not necessary for
Android devices, so revert it to preserve the ABI.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If5aa2baf988b89e504b3b345651352215f571bf8
This commit is contained in:
parent
874997f95f
commit
406300927b
@ -342,7 +342,6 @@ int register_virtio_device(struct virtio_device *dev)
|
||||
virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
|
||||
|
||||
INIT_LIST_HEAD(&dev->vqs);
|
||||
spin_lock_init(&dev->vqs_list_lock);
|
||||
|
||||
/*
|
||||
* device_add() causes the bus infrastructure to look for a matching
|
||||
|
@ -1668,9 +1668,7 @@ static struct virtqueue *vring_create_virtqueue_packed(
|
||||
cpu_to_le16(vq->packed.event_flags_shadow);
|
||||
}
|
||||
|
||||
spin_lock(&vdev->vqs_list_lock);
|
||||
list_add_tail(&vq->vq.list, &vdev->vqs);
|
||||
spin_unlock(&vdev->vqs_list_lock);
|
||||
return &vq->vq;
|
||||
|
||||
err_desc_extra:
|
||||
@ -2128,9 +2126,7 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index,
|
||||
memset(vq->split.desc_state, 0, vring.num *
|
||||
sizeof(struct vring_desc_state_split));
|
||||
|
||||
spin_lock(&vdev->vqs_list_lock);
|
||||
list_add_tail(&vq->vq.list, &vdev->vqs);
|
||||
spin_unlock(&vdev->vqs_list_lock);
|
||||
return &vq->vq;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__vring_new_virtqueue);
|
||||
@ -2214,9 +2210,7 @@ void vring_del_virtqueue(struct virtqueue *_vq)
|
||||
}
|
||||
if (!vq->packed_ring)
|
||||
kfree(vq->split.desc_state);
|
||||
spin_lock(&vq->vq.vdev->vqs_list_lock);
|
||||
list_del(&_vq->list);
|
||||
spin_unlock(&vq->vq.vdev->vqs_list_lock);
|
||||
kfree(vq);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vring_del_virtqueue);
|
||||
@ -2280,12 +2274,10 @@ void virtio_break_device(struct virtio_device *dev)
|
||||
{
|
||||
struct virtqueue *_vq;
|
||||
|
||||
spin_lock(&dev->vqs_list_lock);
|
||||
list_for_each_entry(_vq, &dev->vqs, list) {
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
vq->broken = true;
|
||||
}
|
||||
spin_unlock(&dev->vqs_list_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(virtio_break_device);
|
||||
|
||||
|
@ -111,7 +111,6 @@ struct virtio_device {
|
||||
bool config_enabled;
|
||||
bool config_change_pending;
|
||||
spinlock_t config_lock;
|
||||
spinlock_t vqs_list_lock; /* Protects VQs list access */
|
||||
struct device dev;
|
||||
struct virtio_device_id id;
|
||||
const struct virtio_config_ops *config;
|
||||
|
Loading…
Reference in New Issue
Block a user