sjur.brandeland at stericsson.com
2013-Jan-17 12:22 UTC
[PATCH] virtio_console: Let unconnected rproc device receive data.
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> Allow rproc serial ports to receive data before the port is connected. Rproc serial ports usually talk to very simple remote devices with no control queue managing open/close events. So we must let remote devices write to the virtio ring even if the device is not yet fully initialized. Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> --- This patch is intended for v3.9. Thanks, Sjur drivers/char/virtio_console.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ee4dbea..c17b053 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1763,8 +1763,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-Jan-21 23:21 UTC
[PATCH] virtio_console: Let unconnected rproc device receive data.
sjur.brandeland at stericsson.com writes:> From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > Allow rproc serial ports to receive data before the port > is connected. > > Rproc serial ports usually talk to very simple remote devices > with no control queue managing open/close events. So we must > let remote devices write to the virtio ring even if the device > is not yet fully initialized. > > Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>Thanks, applied. Cheers, Rusty.
Amit Shah
2013-Jan-25 09:10 UTC
[PATCH] virtio_console: Let unconnected rproc device receive data.
On (Thu) 17 Jan 2013 [13:22:42], sjur.brandeland at stericsson.com wrote:> From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > > Allow rproc serial ports to receive data before the port > is connected. > > Rproc serial ports usually talk to very simple remote devices > with no control queue managing open/close events. So we must > let remote devices write to the virtio ring even if the device > is not yet fully initialized. > > Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com> > --- > > This patch is intended for v3.9. > > Thanks, > Sjur > > drivers/char/virtio_console.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c > index ee4dbea..c17b053 100644 > --- a/drivers/char/virtio_console.c > +++ b/drivers/char/virtio_console.c > @@ -1763,8 +1763,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);How about setting port->guest_connected = true in the init routines instead? Keeps this code path cleaner. That's what console ports do as well, in init_port_console(). Amit
Possibly Parallel Threads
- [PATCH] virtio_console: Let unconnected rproc device receive data.
- [PATCH] virtio_console: Initialize guest_connected=true for rproc_serial
- [PATCH] virtio_console: Initialize guest_connected=true for rproc_serial
- [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
- [PATCH] Revert "virtio_console: Initialize guest_connected=true for rproc_serial"