Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d6b6987 authored by Grant Likely's avatar Grant Likely Committed by Josh Boyer
Browse files

[POWERPC] Uartlite: speed up console output



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: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
parent 7ae0fa49
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -329,12 +329,14 @@ static struct uart_ops ulite_ops = {
static void ulite_console_wait_tx(struct uart_port *port)
static void ulite_console_wait_tx(struct uart_port *port)
{
{
	int i;
	int i;
	u8 val;


	/* wait up to 10ms for the character(s) to be sent */
	/* Spin waiting for TX fifo to have space available */
	for (i = 0; i < 10000; i++) {
	for (i = 0; i < 100000; i++) {
		if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
		val = readb(port->membase + ULITE_STATUS);
		if ((val & ULITE_STATUS_TXFULL) == 0)
			break;
			break;
		udelay(1);
		cpu_relax();
	}
	}
}
}