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 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-virtio-console-Fix-early_put_chars-usage.patch Type: text/x-patch Size: 1111 bytes Desc: not available Url : http://lists.linux-foundation.org/pipermail/virtualization/attachments/20100322/94854184/attachment.bin
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 at 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
On 22.03.2010, at 18:45, 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.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
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 at 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