Return-Path: From: alexander.levin@verizon.com Cc: Aaron Sierra , Greg Kroah-Hartman , alexander.levin@verizon.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 14/24] serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X Date: Wed, 22 Nov 2017 22:26:13 +0000 Message-ID: <20171122222604.20122-14-alexander.levin@verizon.com> References: <20171122222604.20122-1-alexander.levin@verizon.com> In-Reply-To: <20171122222604.20122-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Aaron Sierra [ Upstream commit 0ab84da2e076948c49d36197ee7d254125c53eab ] The upper four bits of the XR17V35x fractional divisor register (DLD) control general chip function (RS-485 direction pin polarity, multidrop mode, XON/XOFF parity check, and fast IR mode). Don't allow these bits to be clobbered when setting the baudrate. Signed-off-by: Aaron Sierra Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/= 8250_port.c index 1ef31e3ee4a1..f6e4373a8850 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2526,8 +2526,11 @@ static void serial8250_set_divisor(struct uart_port = *port, unsigned int baud, serial_dl_write(up, quot); =20 /* XR17V35x UARTs have an extra fractional divisor register (DLD) */ - if (up->port.type =3D=3D PORT_XR17V35X) + if (up->port.type =3D=3D PORT_XR17V35X) { + /* Preserve bits not related to baudrate; DLD[7:4]. */ + quot_frac |=3D serial_port_in(port, 0x2) & 0xf0; serial_port_out(port, 0x2, quot_frac); + } } =20 static unsigned int serial8250_get_baud_rate(struct uart_port *port, --=20 2.11.0