sjur.brandeland at stericsson.com
2013-Mar-11 15:15 UTC
[PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b. The reverted patch caused opening of ports to fail for rproc_serial. In probe guest_connected was set to true, but port_fops_open() fails with -EMFILE if guest_connected already is true. Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> --- Hi Rusty, Here is a fix intended for 3.9. Sorry for the churn here :-( Regards, Sjur drivers/char/virtio_console.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index e905d5f..031be0b 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1436,7 +1436,7 @@ static int add_port(struct ports_device *portdev, u32 id) * rproc_serial does not want the console port, only * the generic port implementation. */ - port->host_connected = port->guest_connected = true; + port->host_connected = true; else if (!use_multiport(port->portdev)) { /* * If we're not using multiport support, @@ -1757,8 +1757,11 @@ static void in_intr(struct virtqueue *vq) * tty is spawned) and the host sends out data to console * ports. For generic serial ports, the host won't * (shouldn't) send data till the guest is connected. + * However a remote device might send data before the port is + * connected. So don't remove data from a rproc_serial device. */ - if (!port->guest_connected) + + if (!port->guest_connected && !is_rproc_serial(port->portdev->vdev)) discard_port_data(port); spin_unlock_irqrestore(&port->inbuf_lock, flags); -- 1.7.5.4
Rusty Russell
2013-Mar-12 04:54 UTC
[PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
sjur.brandeland at stericsson.com writes:> From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b. > > The reverted patch caused opening of ports to fail for rproc_serial. > In probe guest_connected was set to true, but port_fops_open() > fails with -EMFILE if guest_connected already is true. > > Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > --- > Hi Rusty, > > Here is a fix intended for 3.9. > Sorry for the churn here :-(Applied, Rusty.
Amit Shah
2013-Mar-12 07:34 UTC
[PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
On (Mon) 11 Mar 2013 [16:15:00], sjur.brandeland at stericsson.com wrote:> From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b. > > The reverted patch caused opening of ports to fail for rproc_serial. > In probe guest_connected was set to true, but port_fops_open() > fails with -EMFILE if guest_connected already is true.OK, I missed that. Can you add a comment near the 2nd hunk mentioning this? Amit
Rusty Russell
2013-Mar-18 08:51 UTC
[PATCHv2] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
Amit Shah <amit.shah at redhat.com> writes:> On (Wed) 13 Mar 2013 [12:10:48], sjur.brandeland at stericsson.com wrote: >> From: Sjur Br??ndeland <sjur.brandeland at stericsson.com> >> >> >> This reverts commit 8078db789a92b10ff6e2d713231b5367e014c53b, and >> adds a lengthy comment explaining the problem area. >> >> The reverted patch caused opening of ports to fail for rproc_serial. >> In probe guest_connected was set to true, but port_fops_open() >> fails with -EMFILE if guest_connected already is true. >> >> Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > Acked-by: Amit Shah <amit.shah at redhat.com> > > AmitApplied to my fixes branch. Thanks, Rusty.
Possibly Parallel Threads
- [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
- [PATCH] virtio_console: Initialize guest_connected=true for rproc_serial
- [PATCH] 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.