linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
@ 2012-11-08  9:17 Amit Shah
  2012-11-16  0:52 ` Rusty Russell
  0 siblings, 1 reply; 8+ messages in thread
From: Amit Shah @ 2012-11-08  9:17 UTC (permalink / raw)
  To: Rusty Russell
  Cc: sjur, Michael S. Tsirkin, linus.walleij, masami.hiramatsu.pt,
	ohad, linux-kernel, virtualization, Sjur Brændeland,
	Amit Shah

From: Sjur Brændeland <sjur.brandeland@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@stericsson.com>
Signed-off-by: Amit Shah <amit.shah@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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-12 12:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08  9:17 [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal Amit Shah
2012-11-16  0:52 ` Rusty Russell
2012-12-10  5:54   ` Amit Shah
2012-12-10 23:09     ` Rusty Russell
2012-12-11  4:10       ` Amit Shah
2012-12-12  0:01         ` Rusty Russell
2012-12-12 12:12           ` Amit Shah
2012-12-12 12:31             ` Sjur BRENDELAND

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).