Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
This reverts commit 8078db789a
, 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@stericsson.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e84e7a56a3
commit
aabd6a8fa5
|
@ -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,
|
||||
|
@ -1752,13 +1752,23 @@ static void in_intr(struct virtqueue *vq)
|
|||
port->inbuf = get_inbuf(port);
|
||||
|
||||
/*
|
||||
* Don't queue up data when port is closed. This condition
|
||||
* Normally the port should not accept data when the port is
|
||||
* closed. For generic serial ports, the host won't (shouldn't)
|
||||
* send data till the guest is connected. But this condition
|
||||
* can be reached when a console port is not yet connected (no
|
||||
* 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.
|
||||
* tty is spawned) and the other side sends out data over the
|
||||
* vring, or when a remote devices start sending data before
|
||||
* the ports are opened.
|
||||
*
|
||||
* A generic serial port will discard data if not connected,
|
||||
* while console ports and rproc-serial ports accepts data at
|
||||
* any time. rproc-serial is initiated with guest_connected to
|
||||
* false because port_fops_open expects this. Console ports are
|
||||
* hooked up with an HVC console and is initialized with
|
||||
* guest_connected to true.
|
||||
*/
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue