Commit d9ad0740 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Kleber Sacilotto de Souza

virtio_console: drop custom control queue cleanup

BugLink: https://bugs.launchpad.net/bugs/1854855

[ Upstream commit 61a8950c ]

We now cleanup all VQs on device removal - no need
to handle the control VQ specially.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 4480649a
...@@ -1987,21 +1987,6 @@ static void remove_vqs(struct ports_device *portdev) ...@@ -1987,21 +1987,6 @@ static void remove_vqs(struct ports_device *portdev)
kfree(portdev->out_vqs); kfree(portdev->out_vqs);
} }
static void remove_controlq_data(struct ports_device *portdev)
{
struct port_buffer *buf;
unsigned int len;
if (!use_multiport(portdev))
return;
while ((buf = virtqueue_get_buf(portdev->c_ivq, &len)))
free_buf(buf, true);
while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq)))
free_buf(buf, true);
}
/* /*
* Once we're further in boot, we get probed like any other virtio * Once we're further in boot, we get probed like any other virtio
* device. * device.
...@@ -2162,7 +2147,6 @@ static void virtcons_remove(struct virtio_device *vdev) ...@@ -2162,7 +2147,6 @@ static void virtcons_remove(struct virtio_device *vdev)
* have to just stop using the port, as the vqs are going * have to just stop using the port, as the vqs are going
* away. * away.
*/ */
remove_controlq_data(portdev);
remove_vqs(portdev); remove_vqs(portdev);
kfree(portdev); kfree(portdev);
} }
...@@ -2207,7 +2191,6 @@ static int virtcons_freeze(struct virtio_device *vdev) ...@@ -2207,7 +2191,6 @@ static int virtcons_freeze(struct virtio_device *vdev)
*/ */
if (use_multiport(portdev)) if (use_multiport(portdev))
virtqueue_disable_cb(portdev->c_ivq); virtqueue_disable_cb(portdev->c_ivq);
remove_controlq_data(portdev);
list_for_each_entry(port, &portdev->ports, list) { list_for_each_entry(port, &portdev->ports, list) {
virtqueue_disable_cb(port->in_vq); virtqueue_disable_cb(port->in_vq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment