linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Virtio_console usage of early printk
@ 2010-03-22 17:45 François Diakhate
  2010-03-23  2:16 ` Amit Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: François Diakhate @ 2010-03-22 17:45 UTC (permalink / raw)
  To: virtualization, linuxppc-dev; +Cc: amit.shah, fdiakh

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

Hi all,

As far as I can see, early_put_chars is not used by virtio_console
because it checks whether there is a port available before using it.
If I understand correctly, this makes it useless because once we have
a port, we can use the regular virtio transport to output things to
the console. Does the attached patch seem valid ? Feedback from s390
and powerpc users who use this functionality would be appreciated.

Thanks,
François

[-- Attachment #2: 0001-virtio-console-Fix-early_put_chars-usage.patch --]
[-- Type: text/x-patch, Size: 1112 bytes --]

From 3961f380bbe84a1036ddfc823039cbee31b44dcb Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= <fdiakh@gmail.com>
Date: Thu, 18 Mar 2010 14:48:20 +0100
Subject: virtio: console: Fix early_put_chars usage

Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it.
---
 drivers/char/virtio_console.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index f404ccf..691ba21 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -645,13 +645,13 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 {
 	struct port *port;
 
+	if (unlikely(early_put_chars))
+		return early_put_chars(vtermno, buf, count);
+
 	port = find_port_by_vtermno(vtermno);
 	if (!port)
 		return 0;
 
-	if (unlikely(early_put_chars))
-		return early_put_chars(vtermno, buf, count);
-
 	return send_buf(port, (void *)buf, count);
 }
 
-- 
1.6.1.3


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

* Re: Virtio_console usage of early printk
  2010-03-22 17:45 Virtio_console usage of early printk François Diakhate
@ 2010-03-23  2:16 ` Amit Shah
  2010-03-23  8:17   ` Christian Borntraeger
  2010-03-23  7:42 ` Alexander Graf
  2010-03-23  8:55 ` Amit Shah
  2 siblings, 1 reply; 6+ messages in thread
From: Amit Shah @ 2010-03-23  2:16 UTC (permalink / raw)
  To: François Diakhate
  Cc: Christian Borntraeger, linuxppc-dev, virtualization

On (Mon) Mar 22 2010 [18:45:47], François Diakhate wrote:
> Hi all,
> 
> As far as I can see, early_put_chars is not used by virtio_console
> because it checks whether there is a port available before using it.
> If I understand correctly, this makes it useless because once we have
> a port, we can use the regular virtio transport to output things to
> the console. Does the attached patch seem valid ? Feedback from s390
> and powerpc users who use this functionality would be appreciated.

Looks OK to me, Christian, others, could you comment on this please?

> Thanks,
> François

> From 3961f380bbe84a1036ddfc823039cbee31b44dcb Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= <fdiakh@gmail.com>
> Date: Thu, 18 Mar 2010 14:48:20 +0100
> Subject: virtio: console: Fix early_put_chars usage
> 
> Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it.
> ---
>  drivers/char/virtio_console.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index f404ccf..691ba21 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -645,13 +645,13 @@ static int put_chars(u32 vtermno, const char *buf, int count)
>  {
>  	struct port *port;
>  
> +	if (unlikely(early_put_chars))
> +		return early_put_chars(vtermno, buf, count);
> +
>  	port = find_port_by_vtermno(vtermno);
>  	if (!port)
>  		return 0;
>  
> -	if (unlikely(early_put_chars))
> -		return early_put_chars(vtermno, buf, count);
> -
>  	return send_buf(port, (void *)buf, count);
>  }
>  
> -- 
> 1.6.1.3
> 


		Amit

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

* Re: Virtio_console usage of early printk
  2010-03-22 17:45 Virtio_console usage of early printk François Diakhate
  2010-03-23  2:16 ` Amit Shah
@ 2010-03-23  7:42 ` Alexander Graf
  2010-03-23  8:55 ` Amit Shah
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2010-03-23  7:42 UTC (permalink / raw)
  To: François Diakhate; +Cc: amit.shah, linuxppc-dev, virtualization


On 22.03.2010, at 18:45, Fran=E7ois Diakhate wrote:

> Hi all,
>=20
> As far as I can see, early_put_chars is not used by virtio_console
> because it checks whether there is a port available before using it.
> If I understand correctly, this makes it useless because once we have
> a port, we can use the regular virtio transport to output things to
> the console. Does the attached patch seem valid ? Feedback from s390
> and powerpc users who use this functionality would be appreciated.

On S390 we use the hypercall interface with characters instead of memory =
addresses as parameters. The hypervisor then decides if the character is =
an early printk or a real hypercall.

I'm not sure how PPC handles that - I never used virtio console there.

Either way, early printk does work for S390. So what exactly is this =
patch supposed to fix?


Alex=

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

* Re: Virtio_console usage of early printk
  2010-03-23  2:16 ` Amit Shah
@ 2010-03-23  8:17   ` Christian Borntraeger
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2010-03-23  8:17 UTC (permalink / raw)
  To: Amit Shah; +Cc: François Diakhate, linuxppc-dev, virtualization

Am Dienstag 23 M=E4rz 2010 03:16:20 schrieb Amit Shah:
> On (Mon) Mar 22 2010 [18:45:47], Fran=E7ois Diakhate wrote:
> > the console. Does the attached patch seem valid ? Feedback from s390
> > and powerpc users who use this functionality would be appreciated.
>=20
> Looks OK to me, Christian, others, could you comment on this please?

Looks good and boot tested with kuli on s390.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>

> > From 3961f380bbe84a1036ddfc823039cbee31b44dcb Mon Sep 17 00:00:00 2001
> > From: =3D?utf-8?q?Fran=3DC3=3DA7ois=3D20Diakhat=3DC3=3DA9?=3D <fdiakh@g=
mail.com>
> > Date: Thu, 18 Mar 2010 14:48:20 +0100
> > Subject: virtio: console: Fix early_put_chars usage
> >=20
> > Currently early_put_chars is not used by virtio_console because it can =
only be used once a port has been found, at which point it's too late becau=
se it is no longer needed. This patch should fix it.
> > ---
> >  drivers/char/virtio_console.c |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> >=20
> > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_consol=
e.c
> > index f404ccf..691ba21 100644
> > --- a/drivers/char/virtio_console.c
> > +++ b/drivers/char/virtio_console.c
> > @@ -645,13 +645,13 @@ static int put_chars(u32 vtermno, const char *buf=
, int count)
> >  {
> >  	struct port *port;
> > =20
> > +	if (unlikely(early_put_chars))
> > +		return early_put_chars(vtermno, buf, count);
> > +
> >  	port =3D find_port_by_vtermno(vtermno);
> >  	if (!port)
> >  		return 0;
> > =20
> > -	if (unlikely(early_put_chars))
> > -		return early_put_chars(vtermno, buf, count);
> > -
> >  	return send_buf(port, (void *)buf, count);
> >  }

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

* Re: Virtio_console usage of early printk
  2010-03-22 17:45 Virtio_console usage of early printk François Diakhate
  2010-03-23  2:16 ` Amit Shah
  2010-03-23  7:42 ` Alexander Graf
@ 2010-03-23  8:55 ` Amit Shah
  2010-03-23 14:58   ` François Diakhate
  2 siblings, 1 reply; 6+ messages in thread
From: Amit Shah @ 2010-03-23  8:55 UTC (permalink / raw)
  To: François Diakhate; +Cc: linuxppc-dev, virtualization

On (Mon) Mar 22 2010 [18:45:47], François Diakhate wrote:
> Hi all,
> 
> As far as I can see, early_put_chars is not used by virtio_console
> because it checks whether there is a port available before using it.
> If I understand correctly, this makes it useless because once we have
> a port, we can use the regular virtio transport to output things to
> the console. Does the attached patch seem valid ? Feedback from s390
> and powerpc users who use this functionality would be appreciated.
> 
> Thanks,
> François

> From 3961f380bbe84a1036ddfc823039cbee31b44dcb Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= <fdiakh@gmail.com>
> Date: Thu, 18 Mar 2010 14:48:20 +0100
> Subject: virtio: console: Fix early_put_chars usage
> 
> Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it.

You'll have to give a signed-off-by for the patch.

		Amit

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

* Re: Virtio_console usage of early printk
  2010-03-23  8:55 ` Amit Shah
@ 2010-03-23 14:58   ` François Diakhate
  0 siblings, 0 replies; 6+ messages in thread
From: François Diakhate @ 2010-03-23 14:58 UTC (permalink / raw)
  To: Amit Shah; +Cc: linuxppc-dev, virtualization

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

On Tue, Mar 23, 2010 at 9:55 AM, Amit Shah <amit.shah@redhat.com> wrote:
> On (Mon) Mar 22 2010 [18:45:47], François Diakhate wrote:
>> Hi all,
>>
>> As far as I can see, early_put_chars is not used by virtio_console
>> because it checks whether there is a port available before using it.
>> If I understand correctly, this makes it useless because once we have
>> a port, we can use the regular virtio transport to output things to
>> the console. Does the attached patch seem valid ? Feedback from s390
>> and powerpc users who use this functionality would be appreciated.
>>
>> Thanks,
>> François
>
>> From 3961f380bbe84a1036ddfc823039cbee31b44dcb Mon Sep 17 00:00:00 2001
>> From: =?utf-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= <fdiakh@gmail.com>
>> Date: Thu, 18 Mar 2010 14:48:20 +0100
>> Subject: virtio: console: Fix early_put_chars usage
>>
>> Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it.
>
> You'll have to give a signed-off-by for the patch.
>
>                Amit
>

Sorry, I didn't have access to my computer this morning. Here is the
patch with a sign-off, if you still need it.

François

[-- Attachment #2: 0001-virtio-console-Fix-early_put_chars-usage.patch --]
[-- Type: text/x-patch, Size: 1265 bytes --]

From 209c553355a3ac04e68a9e9560cea90897588304 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= <fdiakh@gmail.com>
Date: Thu, 18 Mar 2010 14:48:20 +0100
Subject: [PATCH] virtio: console: Fix early_put_chars usage
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it.

Signed-off-by: François Diakhaté <fdiakh@gmail.com>
---
 drivers/char/virtio_console.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index f404ccf..691ba21 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -645,13 +645,13 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 {
 	struct port *port;
 
+	if (unlikely(early_put_chars))
+		return early_put_chars(vtermno, buf, count);
+
 	port = find_port_by_vtermno(vtermno);
 	if (!port)
 		return 0;
 
-	if (unlikely(early_put_chars))
-		return early_put_chars(vtermno, buf, count);
-
 	return send_buf(port, (void *)buf, count);
 }
 
-- 
1.6.3.3


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

end of thread, other threads:[~2010-03-23 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 17:45 Virtio_console usage of early printk François Diakhate
2010-03-23  2:16 ` Amit Shah
2010-03-23  8:17   ` Christian Borntraeger
2010-03-23  7:42 ` Alexander Graf
2010-03-23  8:55 ` Amit Shah
2010-03-23 14:58   ` François Diakhate

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