提交 05884dbf 编写于 作者: P Phil Elwell 提交者: Zheng Zengkai

amba_pl011: Insert mb() for correct FIFO handling

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

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: NPhil Elwell <phil@raspberrypi.org>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 239d5fc7
...@@ -1377,6 +1377,7 @@ static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c, ...@@ -1377,6 +1377,7 @@ static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c,
return false; /* unable to transmit character */ return false; /* unable to transmit character */
pl011_write(c, uap, REG_DR); pl011_write(c, uap, REG_DR);
mb();
uap->port.icount.tx++; uap->port.icount.tx++;
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册