Skip to contentSkip to conversation

tty: amba-pl011: uart_amba_port is not available with earlycon function

PATCH New Shawn Guo 4 participants 4 messages Sep 17, 2016 – Sep 20, 2016

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 tty: amba-pl011: uart_amba_port is not available with earlycon function

Commit 0e125a5facf8 ("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.

Fixes 0e125a5facf8 ("tty: amba-pl011: define flag register bits for ZTE device")
---
 drivers/tty/serial/amba-pl011.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/amba-pl011.c +1 -4
index 0b78b04e895e..2d9ffab16ffe 100644
@@ -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();
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 tty: amba-pl011: uart_amba_port is not available with earlycon function

Quoted 6 lines · Shawn Guo

Commit 0e125a5facf8 ("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.

Quoted 7 lines

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

Fixes 0e125a5facf8 ("tty: amba-pl011: define flag register bits for ZTE device")

Hi Sudeep,

Can you please confirm if the patch fixes your problem, so that Greg knows whether it should be applied? Thanks.

Shawn

#2 lore raw

PATCH 1/1 tty: amba-pl011: uart_amba_port is not available with earlycon function

Quoted 11 lines · Shawn Guo
Quoted 10 lines · Shawn Guo

Commit 0e125a5facf8 ("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.

Quoted 9 lines
Quoted 3 lines
Fixes 0e125a5facf8 ("tty: amba-pl011: define flag register bits for ZTE device")

Hi Sudeep,

Can you please confirm if the patch fixes your problem, so that Greg knows whether it should be applied? Thanks.

Sorry, since it's basically what I tried first before posting some patch using private_data, I assumed it will work.

Anyways I have now tested it, so you can add:

Signature · 2 lines
Regards,
Sudeep
#3 lore raw

PATCH 1/1 tty: amba-pl011: uart_amba_port is not available with earlycon function

Quoted 2 lines · Sudeep Holla

Anyways I have now tested it, so you can add:

Sorry for the regression, and thanks much for the effort of issue reporting and testing.

Shawn