Skip to content

Commit

Permalink
virtio_console: Initialize guest_connected=true for rproc_serial
Browse files Browse the repository at this point in the history
When rproc_serial is initialized, guest_connected should be set
to true. We can then revert the extra checks introduced in
commit: "virtio_console: Let unconnected rproc device receive data."

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Sjur Brændeland authored and Rusty Russell committed Feb 13, 2013
1 parent b2a1702 commit 8078db7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = true;
port->host_connected = port->guest_connected = true;
else if (!use_multiport(port->portdev)) {
/*
* If we're not using multiport support,
Expand Down Expand Up @@ -1757,11 +1757,8 @@ 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 && !is_rproc_serial(port->portdev->vdev))
if (!port->guest_connected)
discard_port_data(port);

spin_unlock_irqrestore(&port->inbuf_lock, flags);
Expand Down

0 comments on commit 8078db7

Please sign in to comment.