ar7: add kernel 4.9 support
[openwrt/openwrt.git] / target / linux / ar7 / patches-4.9 / 002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
1 From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sun, 29 Oct 2017 15:50:42 +0100
4 Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
5
6 Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt
7 trigger I/F of FIFO buffers"), the port's default FCR value isn't used
8 in serial8250_do_set_termios anymore, but copied over once in
9 serial8250_config_port and then modified as needed.
10
11 Unfortunately, serial8250_config_port will never be called if the port
12 is shared between kernel and userspace, and the port's flag doesn't have
13 UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well.
14
15 This causes garbled output from userspace:
16
17 [ 5.220000] random: procd urandom read with 49 bits of entropy available
18 ers
19 [kee
20
21 Fix this by forcing it to be configured on boot, resulting in the
22 expected output:
23
24 [ 5.250000] random: procd urandom read with 50 bits of entropy available
25 Press the [f] key and hit [enter] to enter failsafe mode
26 Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
27
28 Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers")
29 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
30 ---
31 I'm not sure if this is just AR7's issue, or if this points to a general
32 issue for UARTs used as kernel console and login console with the "fixed"
33 commit.
34
35 arch/mips/ar7/platform.c | 2 +-
36 1 file changed, 1 insertion(+), 1 deletion(-)
37
38 --- a/arch/mips/ar7/platform.c
39 +++ b/arch/mips/ar7/platform.c
40 @@ -576,7 +576,7 @@ static int __init ar7_register_uarts(voi
41 uart_port.type = PORT_AR7;
42 uart_port.uartclk = clk_get_rate(bus_clk) / 2;
43 uart_port.iotype = UPIO_MEM32;
44 - uart_port.flags = UPF_FIXED_TYPE;
45 + uart_port.flags = UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF;
46 uart_port.regshift = 2;
47
48 uart_port.line = 0;