Skip to content

Commit

Permalink
vsock/virtio: enable VQs early on probe
Browse files Browse the repository at this point in the history
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, but virtio-vsock
driver uses VQs in the probe function to fill rx and event VQs
with new buffers.

Let's fix this, calling virtio_device_ready() before using VQs
in the probe function.

Fixes: 0ea9e1d ("VSOCK: Introduce virtio_transport.ko")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Stefano Garzarella authored and Jakub Kicinski committed Mar 25, 2022
1 parent c1011c0 commit 8870445
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/vmw_vsock/virtio_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ static int virtio_vsock_probe(struct virtio_device *vdev)

vdev->priv = vsock;

virtio_device_ready(vdev);

mutex_lock(&vsock->tx_lock);
vsock->tx_run = true;
mutex_unlock(&vsock->tx_lock);
Expand Down

0 comments on commit 8870445

Please sign in to comment.