LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: paulus@samba.org, linuxppc-dev@ozlabs.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 4/4] Uartlite: speed up console output
Date: Mon, 22 Oct 2007 22:27:46 -0600	[thread overview]
Message-ID: <20071023042746.30309.15188.stgit@trillian.cg.shawcable.net> (raw)
In-Reply-To: <20071023042353.30309.93118.stgit@trillian.cg.shawcable.net>

From: Grant Likely <grant.likely@secretlab.ca>

Change the wait_tx routine to call cpu_relax() instead of udelay() to
reduce console output latency and test for the TXFULL bit instead of
TXEMPTY.  That way the FIFO doesn't need to by 100% flushed before
writing the next character.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 drivers/serial/uartlite.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index dfef83f..a85f2d3 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -329,12 +329,14 @@ static struct uart_ops ulite_ops = {
 static void ulite_console_wait_tx(struct uart_port *port)
 {
 	int i;
+	u8 val;
 
-	/* wait up to 10ms for the character(s) to be sent */
-	for (i = 0; i < 10000; i++) {
-		if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
+	/* Spin waiting for TX fifo to have space available */
+	for (i = 0; i < 100000; i++) {
+		val = readb(port->membase + ULITE_STATUS);
+		if ((val & ULITE_STATUS_TXFULL) == 0)
 			break;
-		udelay(1);
+		cpu_relax();
 	}
 }
 

  parent reply	other threads:[~2007-10-23  4:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23  4:27 [PATCH 0/4] Misc patches for the 2.6.24 merge window Grant Likely
2007-10-23  4:27 ` [PATCH 1/4] bootwrapper: Allow wrapper script to execute verbosely Grant Likely
2007-10-23  4:27 ` [PATCH 2/4] bootwrapper: Bail from script if any command fails Grant Likely
2007-10-23  4:27 ` [PATCH 3/4] Device tree bindings for Xilinx devices Grant Likely
2007-10-23 12:36   ` Josh Boyer
2007-10-23  4:27 ` Grant Likely [this message]
2007-10-31 14:45   ` [PATCH 4/4] Uartlite: speed up console output Peter Korsgaard

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=20071023042746.30309.15188.stgit@trillian.cg.shawcable.net \
    --to=grant.likely@secretlab.ca \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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