diff mbox

[00/10] drivers: PL011: add ARM SBSA Generic UART support

Message ID 20150120143254.GB17657@e103592.cambridge.arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Martin Jan. 20, 2015, 2:32 p.m. UTC
On Tue, Jan 20, 2015 at 01:08:32PM +0000, Graeme Gregory wrote:

[...]

> I have tested this series on Juno where it seems to work and also on FVP
> model where there are some issues.
> 
> On the FVP when we enter usespace a couple of 32 character strings are
> printed then nothing else. 32 Characters is a suspicious number.
> 
> This occurs with both OE based FS from linaro and debian ubstable FS.
> 
> My FVP is version 5602

Can you try this:



If we can hit that BUG_ON, then it's possible tx_avail is wrapping round
here, though I'm not sure if it is likely to occur in practice.

I'll have a look for other potential issues...

Cheers
---Dave
diff mbox

Patch

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index eb397c7..9ca78db 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1291,6 +1291,7 @@  static void pl011_tx_chars(struct uart_amba_port *uap)
 		writew(uap->port.x_char, uap->port.membase + UART01x_DR);
 		uap->port.icount.tx++;
 		uap->port.x_char = 0;
+		BUG_ON(uap->tx_avail < 1);
 		uap->tx_avail--;
 		return;
 	}