From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0091.outbound.protection.outlook.com ([104.47.36.91]:53152 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032210AbeCAPaZ (ORCPT ); Thu, 1 Mar 2018 10:30:25 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Jonas Gorski , Ralf Baechle , Sasha Levin Subject: [added to the 4.1 stable tree] MIPS: AR7: ensure the port type's FCR value is used Date: Thu, 1 Mar 2018 15:24:33 +0000 Message-ID: <20180301152116.1486-200-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Jonas Gorski This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 0a5191efe06b5103909206e4fbcff81d30283f8e ] Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers"), the port's default FCR value isn't used in serial8250_do_set_termios anymore, but copied over once in serial8250_config_port and then modified as needed. Unfortunately, serial8250_config_port will never be called if the port is shared between kernel and userspace, and the port's flag doesn't have UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. This causes garbled output from userspace: [ 5.220000] random: procd urandom read with 49 bits of entropy available ers [kee Fix this by forcing it to be configured on boot, resulting in the expected output: [ 5.250000] random: procd urandom read with 50 bits of entropy available Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug leve= l Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/= F of FIFO buffers") Signed-off-by: Jonas Gorski Cc: Greg Kroah-Hartman Cc: Yoshihiro YUNOMAE Cc: Florian Fainelli Cc: Nicolas Schichan Cc: linux-mips@linux-mips.org Cc: linux-serial@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/17544/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin --- arch/mips/ar7/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c index 5afbb7b41160..d60986fdc288 100644 --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c @@ -577,7 +577,7 @@ static int __init ar7_register_uarts(void) uart_port.type =3D PORT_AR7; uart_port.uartclk =3D clk_get_rate(bus_clk) / 2; uart_port.iotype =3D UPIO_MEM32; - uart_port.flags =3D UPF_FIXED_TYPE; + uart_port.flags =3D UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; uart_port.regshift =3D 2; =20 uart_port.line =3D 0; --=20 2.14.1