aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorSjur Brændeland <sjur.brandeland@stericsson.com>2013-01-21 18:21:20 -0500
committerRusty Russell <rusty@rustcorp.com.au>2013-01-22 01:58:40 -0500
commit1f8051876a194d7f7fe7834d9853f240d6b4b9ab (patch)
tree1aa4b9823fb30f308075429e5fd08253216e3adb /drivers/char
parent226364766f936d249e408de03821468c1bf11dda (diff)
virtio_console: Let unconnected rproc device receive data.
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@stericsson.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 684b0d53764f..95cae778bd73 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1763,8 +1763,11 @@ static void in_intr(struct virtqueue *vq)
1763 * tty is spawned) and the host sends out data to console 1763 * tty is spawned) and the host sends out data to console
1764 * ports. For generic serial ports, the host won't 1764 * ports. For generic serial ports, the host won't
1765 * (shouldn't) send data till the guest is connected. 1765 * (shouldn't) send data till the guest is connected.
1766 * However a remote device might send data before the port is
1767 * connected. So don't remove data from a rproc_serial device.
1766 */ 1768 */
1767 if (!port->guest_connected) 1769
1770 if (!port->guest_connected && !is_rproc_serial(port->portdev->vdev))
1768 discard_port_data(port); 1771 discard_port_data(port);
1769 1772
1770 spin_unlock_irqrestore(&port->inbuf_lock, flags); 1773 spin_unlock_irqrestore(&port->inbuf_lock, flags);