From: Paolo Bonzini Date: Wed, 13 Jun 2012 14:56:31 +0000 (+0200) Subject: [SCSI] virtio-scsi: unlock during kick X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b5ee8f2802c559fccb177c0a117f5cd56c1049cc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [SCSI] virtio-scsi: unlock during kick Separate virtqueue_kick_prepare from virtqueue_notify, so that the expensive vmexit is done without holding the lock. Signed-off-by: Paolo Bonzini Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 1b3843117268..b0ad5aa6b552 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -264,9 +264,11 @@ static int virtscsi_kick_cmd(struct virtio_scsi *vscsi, struct virtqueue *vq, ret = virtqueue_add_buf(vq, vscsi->sg, out_num, in_num, cmd, gfp); if (ret >= 0) - virtqueue_kick(vq); + ret = virtqueue_kick_prepare(vq); spin_unlock_irqrestore(&vscsi->vq_lock, flags); + if (ret > 0) + virtqueue_notify(vq); return ret; }