Skip to content

Commit b84ce14

Browse files
author
Phil Elwell
committed
amba_pl011: Insert mb() for correct FIFO handling
The pl011 register accessor functions use the _relaxed versions of the standard readl() and writel() functions, meaning that there are no automatic memory barriers. When polling a FIFO status register to check for fullness, it is necessary to ensure that any outstanding writes have completed; otherwise the flags are effectively stale, making it possible that the next write is to a full FIFO. Signed-off-by: Phil Elwell <[email protected]>
1 parent cd361b3 commit b84ce14

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/tty/serial/amba-pl011.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,7 @@ static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c,
13841384
return false; /* unable to transmit character */
13851385

13861386
pl011_write(c, uap, REG_DR);
1387+
mb();
13871388
uap->port.icount.tx++;
13881389

13891390
return true;

0 commit comments

Comments
 (0)