Skip to content

Commit

Permalink
tty: amba-pl011: uart_amba_port is not available with earlycon function
Browse files Browse the repository at this point in the history
Commit 0e125a5 ("tty: amba-pl011: define flag register bits for ZTE
device") changes earlycon function pl011_putc() to use a pointer to
uart_amba_port.  This causes a regression when earlycon is enabled,
because uart_amba_port is not available yet at earlycon time.  Let's
revert the change on pl011_putc() to fix the regression.

The earlycon support for ZTE device can probably be added later by
declaring a new earlycon setup function with a vendor specific
compatible.

Reported-by: Sudeep Holla <[email protected]>
Fixes: 0e125a5 ("tty: amba-pl011: define flag register bits for ZTE device")
Signed-off-by: Shawn Guo <[email protected]>
Tested-by: Sudeep Holla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
shawnguo2 authored and gregkh committed Sep 22, 2016
1 parent 1664bc4 commit e06690b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,16 +2330,13 @@ static struct console amba_console = {

static void pl011_putc(struct uart_port *port, int c)
{
struct uart_amba_port *uap =
container_of(port, struct uart_amba_port, port);

while (readl(port->membase + UART01x_FR) & UART01x_FR_TXFF)
cpu_relax();
if (port->iotype == UPIO_MEM32)
writel(c, port->membase + UART01x_DR);
else
writeb(c, port->membase + UART01x_DR);
while (readl(port->membase + UART01x_FR) & uap->vendor->fr_busy)
while (readl(port->membase + UART01x_FR) & UART01x_FR_BUSY)
cpu_relax();
}

Expand Down

0 comments on commit e06690b

Please sign in to comment.