leon: add SDK patches from buildroot-2022.02-1.2/5.10.175
[openwrt/staging/wigyori.git] / target / linux / leon / patches-5.15 / 0014-sparc32-leon-prevent-long-uart-fifo-discovery-loop.patch
1 From 5d82acbb9a8c98fe7eb86a59f3f1471a713f8c92 Mon Sep 17 00:00:00 2001
2 From: Konrad Eisele <konrad@gaisler.com>
3 Date: Tue, 10 Apr 2012 15:22:11 +0200
4 Subject: [PATCH 14/32] sparc32,leon: prevent long uart fifo discovery loop
5
6 On GR712 uart might be disabled. To avoid spinning forever limit loopcount
7
8 Signed-off-by: Konrad Eisele <konrad@gaisler.com>
9 ---
10 drivers/tty/serial/apbuart.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13 diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
14 index e8d56e899ec7..a22c48e5d217 100644
15 --- a/drivers/tty/serial/apbuart.c
16 +++ b/drivers/tty/serial/apbuart.c
17 @@ -363,7 +363,7 @@ static int apbuart_scan_fifo_size(struct uart_port *port, int portnumber)
18
19 UART_PUT_CTRL(port, ctrl | UART_CTRL_TE);
20
21 - while (!UART_TX_READY(UART_GET_STATUS(port)))
22 + while ((!UART_TX_READY(UART_GET_STATUS(port))) && loop < 0x7fffff)
23 loop++;
24
25 /*
26 --
27 2.34.1
28