brcm2708: add kernel 4.14 support
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0121-amba_pl011-Insert-mb-for-correct-FIFO-handling.patch
1 From 436e9b301802720c0bf0f080301263c6e926d723 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Fri, 29 Sep 2017 10:32:19 +0100
4 Subject: [PATCH 121/454] amba_pl011: Insert mb() for correct FIFO handling
5
6 The pl011 register accessor functions use the _relaxed versions of the
7 standard readl() and writel() functions, meaning that there are no
8 automatic memory barriers. When polling a FIFO status register to check
9 for fullness, it is necessary to ensure that any outstanding writes have
10 completed; otherwise the flags are effectively stale, making it possible
11 that the next write is to a full FIFO.
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
14 ---
15 drivers/tty/serial/amba-pl011.c | 1 +
16 1 file changed, 1 insertion(+)
17
18 --- a/drivers/tty/serial/amba-pl011.c
19 +++ b/drivers/tty/serial/amba-pl011.c
20 @@ -1403,6 +1403,7 @@ static bool pl011_tx_char(struct uart_am
21 return false; /* unable to transmit character */
22
23 pl011_write(c, uap, REG_DR);
24 + mb();
25 uap->port.icount.tx++;
26
27 return true;