diff options
author | Zhu Lingshan <lingshan.zhu@intel.com> | 2020-09-09 14:52:34 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-10-21 10:48:10 -0400 |
commit | 86e182fe12ee5869022614457037097c70fe2ed1 (patch) | |
tree | 1ad7af0a73787d36f2711762a39bdf633d9dff86 /drivers/vhost/vdpa.c | |
parent | 5745bcfbbf89b158416075374254d3c013488f21 (diff) | |
download | linux-86e182fe12ee5869022614457037097c70fe2ed1.tar.gz linux-86e182fe12ee5869022614457037097c70fe2ed1.tar.bz2 linux-86e182fe12ee5869022614457037097c70fe2ed1.zip |
vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call
This commit removed unnecessary spin_locks in vhost_vring_call
and related operations. Because we manipulate irq offloading
contents in vhost_vdpa ioctl code path which is already
protected by dev mutex and vq mutex.
Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/r/20200909065234.3313-1-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vhost/vdpa.c')
-rw-r--r-- | drivers/vhost/vdpa.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 0bef5b10f044..a2dbc85e0b0d 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -96,26 +96,20 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid) return; irq = ops->get_vq_irq(vdpa, qid); - spin_lock(&vq->call_ctx.ctx_lock); irq_bypass_unregister_producer(&vq->call_ctx.producer); - if (!vq->call_ctx.ctx || irq < 0) { - spin_unlock(&vq->call_ctx.ctx_lock); + if (!vq->call_ctx.ctx || irq < 0) return; - } vq->call_ctx.producer.token = vq->call_ctx.ctx; vq->call_ctx.producer.irq = irq; ret = irq_bypass_register_producer(&vq->call_ctx.producer); - spin_unlock(&vq->call_ctx.ctx_lock); } static void vhost_vdpa_unsetup_vq_irq(struct vhost_vdpa *v, u16 qid) { struct vhost_virtqueue *vq = &v->vqs[qid]; - spin_lock(&vq->call_ctx.ctx_lock); irq_bypass_unregister_producer(&vq->call_ctx.producer); - spin_unlock(&vq->call_ctx.ctx_lock); } static void vhost_vdpa_reset(struct vhost_vdpa *v) |