virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio_console: Let unconnected rproc device receive data.
@ 2013-01-17 12:22 sjur.brandeland
  2013-01-21 23:21 ` Rusty Russell
  2013-01-25  9:10 ` Amit Shah
  0 siblings, 2 replies; 10+ messages in thread
From: sjur.brandeland @ 2013-01-17 12:22 UTC (permalink / raw)
  To: Amit Shah; +Cc: virtualization, Sjur Brændeland, Michael S. Tsirkin

From: Sjur Brændeland <sjur.brandeland@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@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

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-01-17 12:22 [PATCH] virtio_console: Let unconnected rproc device receive data sjur.brandeland
@ 2013-01-21 23:21 ` Rusty Russell
  2013-01-25  9:10 ` Amit Shah
  1 sibling, 0 replies; 10+ messages in thread
From: Rusty Russell @ 2013-01-21 23:21 UTC (permalink / raw)
  To: Amit Shah; +Cc: virtualization, Sjur Brændeland, Michael S. Tsirkin

sjur.brandeland@stericsson.com writes:
> From: Sjur Brændeland <sjur.brandeland@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@stericsson.com>

Thanks, applied.

Cheers,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-01-17 12:22 [PATCH] virtio_console: Let unconnected rproc device receive data sjur.brandeland
  2013-01-21 23:21 ` Rusty Russell
@ 2013-01-25  9:10 ` Amit Shah
  2013-01-25 11:24   ` Sjur BRENDELAND
  1 sibling, 1 reply; 10+ messages in thread
From: Amit Shah @ 2013-01-25  9:10 UTC (permalink / raw)
  To: sjur.brandeland; +Cc: virtualization, Michael S. Tsirkin

On (Thu) 17 Jan 2013 [13:22:42], sjur.brandeland@stericsson.com wrote:
> From: Sjur Brændeland <sjur.brandeland@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@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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-01-25  9:10 ` Amit Shah
@ 2013-01-25 11:24   ` Sjur BRENDELAND
  2013-02-12  9:14     ` Sjur Brændeland
  0 siblings, 1 reply; 10+ messages in thread
From: Sjur BRENDELAND @ 2013-01-25 11:24 UTC (permalink / raw)
  To: Amit Shah; +Cc: virtualization@lists.linux-foundation.org, Michael S. Tsirkin

Hi Amit,

> > @@ -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.

Agree, I'll respin this patch.

Thanks,
Sjur

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-01-25 11:24   ` Sjur BRENDELAND
@ 2013-02-12  9:14     ` Sjur Brændeland
  2013-02-12  9:26       ` Amit Shah
  2013-02-12  9:42       ` Michael S. Tsirkin
  0 siblings, 2 replies; 10+ messages in thread
From: Sjur Brændeland @ 2013-02-12  9:14 UTC (permalink / raw)
  To: Amit Shah, Rusty Russell
  Cc: Michael S. Tsirkin, Erwan.Yvin,
	virtualization@lists.linux-foundation.org

Hi Amit,

> > @@ -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.
>
> Agree, I'll respin this patch.

Hm, Rusty has already picked this up. Do you still want me to do a respin,
or should I leave it as is?

Regards,
Sjur

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-02-12  9:14     ` Sjur Brændeland
@ 2013-02-12  9:26       ` Amit Shah
  2013-02-12  9:42       ` Michael S. Tsirkin
  1 sibling, 0 replies; 10+ messages in thread
From: Amit Shah @ 2013-02-12  9:26 UTC (permalink / raw)
  To: Sjur Brændeland
  Cc: Michael S. Tsirkin, Erwan.Yvin,
	virtualization@lists.linux-foundation.org

On (Tue) 12 Feb 2013 [10:14:59], Sjur Brændeland wrote:
> Hi Amit,
> 
> > > @@ -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.
> >
> > Agree, I'll respin this patch.
> 
> Hm, Rusty has already picked this up. Do you still want me to do a respin,
> or should I leave it as is?

Please respin.

		Amit

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-02-12  9:14     ` Sjur Brændeland
  2013-02-12  9:26       ` Amit Shah
@ 2013-02-12  9:42       ` Michael S. Tsirkin
  2013-02-12 10:01         ` Sjur Brændeland
  1 sibling, 1 reply; 10+ messages in thread
From: Michael S. Tsirkin @ 2013-02-12  9:42 UTC (permalink / raw)
  To: Sjur Brændeland
  Cc: Amit Shah, Erwan.Yvin, virtualization@lists.linux-foundation.org

On Tue, Feb 12, 2013 at 10:14:59AM +0100, Sjur Brændeland wrote:
> Hi Amit,
> 
> > > @@ -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.
> >
> > Agree, I'll respin this patch.
> 
> Hm, Rusty has already picked this up.

I don't see it in virtio-next. Do you?

> Do you still want me to do a respin,
> or should I leave it as is?
> 
> Regards,
> Sjur

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-02-12  9:42       ` Michael S. Tsirkin
@ 2013-02-12 10:01         ` Sjur Brændeland
  2013-02-12 10:09           ` Michael S. Tsirkin
  0 siblings, 1 reply; 10+ messages in thread
From: Sjur Brændeland @ 2013-02-12 10:01 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Amit Shah, Erwan.Yvin, virtualization@lists.linux-foundation.org

On Tue, Feb 12, 2013 at 10:42 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
...
> > > > How about setting port->guest_connected = true in the init routines
> > > > instead?  Keeps this code path cleaner.
> > >
> > > Agree, I'll respin this patch.
> >
> > Hm, Rusty has already picked this up.
>
> I don't see it in virtio-next. Do you?


Yes I do, see:

http://git.kernel.org/?p=linux/kernel/git/rusty/linux.git;a=commitdiff;h=1f8051876a194d7f7fe7834d9853f240d6b4b9ab;hp=226364766f936d249e408de03821468c1bf11dda

Regards,
Sjur

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-02-12 10:01         ` Sjur Brændeland
@ 2013-02-12 10:09           ` Michael S. Tsirkin
  2013-02-18 22:57             ` Rusty Russell
  0 siblings, 1 reply; 10+ messages in thread
From: Michael S. Tsirkin @ 2013-02-12 10:09 UTC (permalink / raw)
  To: Sjur Brændeland
  Cc: Amit Shah, Erwan.Yvin, virtualization@lists.linux-foundation.org

On Tue, Feb 12, 2013 at 11:01:10AM +0100, Sjur Brændeland wrote:
> On Tue, Feb 12, 2013 at 10:42 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> ...
> > > > > How about setting port->guest_connected = true in the init routines
> > > > > instead?  Keeps this code path cleaner.
> > > >
> > > > Agree, I'll respin this patch.
> > >
> > > Hm, Rusty has already picked this up.
> >
> > I don't see it in virtio-next. Do you?
> 
> 
> Yes I do, see:
> 
> http://git.kernel.org/?p=linux/kernel/git/rusty/linux.git;a=commitdiff;h=1f8051876a194d7f7fe7834d9853f240d6b4b9ab;hp=226364766f936d249e408de03821468c1bf11dda
> 
> Regards,
> Sjur

Right, missed this. In this case better to send an incremental patch I
think, we don't want rebases unless absolutely required.

-- 
MST

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] virtio_console: Let unconnected rproc device receive data.
  2013-02-12 10:09           ` Michael S. Tsirkin
@ 2013-02-18 22:57             ` Rusty Russell
  0 siblings, 0 replies; 10+ messages in thread
From: Rusty Russell @ 2013-02-18 22:57 UTC (permalink / raw)
  To: Michael S. Tsirkin, Sjur Brændeland
  Cc: Amit Shah, Erwan.Yvin, virtualization@lists.linux-foundation.org

"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Tue, Feb 12, 2013 at 11:01:10AM +0100, Sjur Brændeland wrote:
>> On Tue, Feb 12, 2013 at 10:42 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> ...
>> > > > > How about setting port->guest_connected = true in the init routines
>> > > > > instead?  Keeps this code path cleaner.
>> > > >
>> > > > Agree, I'll respin this patch.
>> > >
>> > > Hm, Rusty has already picked this up.
>> >
>> > I don't see it in virtio-next. Do you?
>> 
>> 
>> Yes I do, see:
>> 
>> http://git.kernel.org/?p=linux/kernel/git/rusty/linux.git;a=commitdiff;h=1f8051876a194d7f7fe7834d9853f240d6b4b9ab;hp=226364766f936d249e408de03821468c1bf11dda
>> 
>> Regards,
>> Sjur
>
> Right, missed this. In this case better to send an incremental patch I
> think, we don't want rebases unless absolutely required.

Indeed, I try not to rebase virtio-next.  pending-rebases is where I put
stuff which can be wildly rebased...

Cheers,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-02-18 22:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 12:22 [PATCH] virtio_console: Let unconnected rproc device receive data sjur.brandeland
2013-01-21 23:21 ` Rusty Russell
2013-01-25  9:10 ` Amit Shah
2013-01-25 11:24   ` Sjur BRENDELAND
2013-02-12  9:14     ` Sjur Brændeland
2013-02-12  9:26       ` Amit Shah
2013-02-12  9:42       ` Michael S. Tsirkin
2013-02-12 10:01         ` Sjur Brændeland
2013-02-12 10:09           ` Michael S. Tsirkin
2013-02-18 22:57             ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).