linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "François Diakhate" <fdiakh@gmail.com>
To: virtualization@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org
Cc: amit.shah@redhat.com, fdiakh@gmail.com
Subject: Virtio_console usage of early printk
Date: Mon, 22 Mar 2010 18:45:47 +0100	[thread overview]
Message-ID: <6ad07c641003221045m10ee5c84x3a92436582600f21@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2010-03-22 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 17:45 François Diakhate [this message]
2010-03-23  2:16 ` Virtio_console usage of early printk 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ad07c641003221045m10ee5c84x3a92436582600f21@mail.gmail.com \
    --to=fdiakh@gmail.com \
    --cc=amit.shah@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).