diff options
author | Johan Hovold <johan@kernel.org> | 2021-03-30 17:37:16 +0300 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2021-04-01 11:02:13 +0300 |
commit | ea7ada4de2f7406150dd35ecd0302842587a464e (patch) | |
tree | 7d85003019704a688019d6d07c41460dc4e0bdcf /drivers/usb/serial/xr_serial.c | |
parent | 315e2811f58b807e6e76b7385e3d7b970f4562d2 (diff) | |
download | linux-ea7ada4de2f7406150dd35ecd0302842587a464e.tar.xz |
USB: serial: xr: fix CSIZE handling
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@kernel.org>
Cc: stable@vger.kernel.org # 5.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/xr_serial.c')
-rw-r--r-- | drivers/usb/serial/xr_serial.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 0ca04906da4b..c59c8b47a120 100644 --- 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_struct *tty, 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: |