leon: add SDK patches from buildroot-2022.02-1.2/5.10.175
[openwrt/staging/wigyori.git] / target / linux / leon / patches-5.15 / 0017-tty-serial-apbuart-Clear-error-and-break-bits-at-pro.patch
1 From 72f84f6598168f11c9c5d17ccbd9a5ce66868cbb Mon Sep 17 00:00:00 2001
2 From: Andreas Larsson <andreas@gaisler.com>
3 Date: Tue, 22 Jun 2021 18:25:12 +0200
4 Subject: [PATCH 17/32] tty/serial/apbuart: Clear error and break bits at probe
5 time
6
7 Otherwise old bits laying around can trigger things like an old break
8 bit triggering sysrq at first intput even though the break condition was
9 ancient.
10
11 Signed-off-by: Andreas Larsson <andreas@gaisler.com>
12 ---
13 drivers/tty/serial/apbuart.c | 3 +++
14 1 file changed, 3 insertions(+)
15
16 diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
17 index a22c48e5d217..385d58c2cf04 100644
18 --- a/drivers/tty/serial/apbuart.c
19 +++ b/drivers/tty/serial/apbuart.c
20 @@ -564,6 +564,9 @@ static int apbuart_probe(struct platform_device *op)
21
22 apbuart_flush_fifo((struct uart_port *) port);
23
24 + /* Clear any errors or breaks */
25 + UART_PUT_STATUS(port, 0);
26 +
27 printk(KERN_INFO "grlib-apbuart at 0x%llx, irq %d\n",
28 (unsigned long long) port->mapbase, port->irq);
29 return 0;
30 --
31 2.34.1
32