[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210512144838.001863146@linuxfoundation.org>
Date: Wed, 12 May 2021 16:41:09 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Manivannan Sadhasivam <mani@...nel.org>,
Johan Hovold <johan@...nel.org>
Subject: [PATCH 5.12 023/677] USB: serial: xr: fix CSIZE handling
From: Johan Hovold <johan@...nel.org>
commit ea7ada4de2f7406150dd35ecd0302842587a464e upstream.
The XR21V141X does not have a 5- or 6-bit mode, but the current
implementation failed to properly restore the old setting when CS5 or
CS6 was requested. Instead an invalid request would be sent to the
device.
Fixes: c2d405aa86b4 ("USB: serial: add MaxLinear/Exar USB to Serial driver")
Reviewed-by: Manivannan Sadhasivam <mani@...nel.org>
Cc: stable@...r.kernel.org # 5.12
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/usb/serial/xr_serial.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -468,6 +468,11 @@ static void xr_set_termios(struct tty_st
if (old_termios)
termios->c_cflag |= old_termios->c_cflag & CSIZE;
else
+ termios->c_cflag |= CS8;
+
+ if (C_CSIZE(tty) == CS7)
+ bits |= XR21V141X_UART_DATA_7;
+ else
bits |= XR21V141X_UART_DATA_8;
break;
case CS7:
Powered by blists - more mailing lists