Amit Shah
2012-Nov-08 09:17 UTC
[[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> Remove buffers from the out-queue when a port is removed. Rproc_serial communicates with remote processors that may crash and leave buffers in the out-queue. The virtio serial ports may have buffers in the out-queue as well, e.g. for non-blocking ports and the host didn't consume them yet. [Amit: Remove WARN_ON for generic ports case.] Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> Signed-off-by: Amit Shah <amit.shah at redhat.com> --- drivers/char/virtio_console.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 9ebadcb..5ff3b3e 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1521,6 +1521,10 @@ static void remove_port_data(struct port *port) /* Remove buffers we queued up for the Host to send us data in. */ while ((buf = virtqueue_detach_unused_buf(port->in_vq))) free_buf(buf, true); + + /* Remove buffers we queued up for the Host to consume */ + while ((buf = virtqueue_detach_unused_buf(port->out_vq))) + free_buf(buf, true); } /* -- 1.7.7.6
Rusty Russell
2012-Nov-16 00:52 UTC
[[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
Amit Shah <amit.shah at redhat.com> writes:> From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > Remove buffers from the out-queue when a port is removed. Rproc_serial > communicates with remote processors that may crash and leave buffers in > the out-queue. The virtio serial ports may have buffers in the out-queue > as well, e.g. for non-blocking ports and the host didn't consume them > yet. > > [Amit: Remove WARN_ON for generic ports case.] > > Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > Signed-off-by: Amit Shah <amit.shah at redhat.com>I already have this in my pending queue; I've promoted it to my virtio-next branch now. Thanks, Rusty.
Apparently Analagous Threads
- [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
- [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
- [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
- [PATCH] virtio_console: Let unconnected rproc device receive data.
- [PATCH] virtio_console: Let unconnected rproc device receive data.