linux/drivers/usb/serial
Johan Hovold f51ccf4621 USB: serial: console: fix reported terminal settings
The USB-serial console implementation has never reported the actual
terminal settings used. Despite storing the corresponding cflags in its
struct console, these were never honoured on later tty open() where the
tty termios would be left initialised to the driver defaults.

Unlike the serial console implementation, the USB-serial code calls
subdriver open() already at console setup. While calling set_termios()
and write() before open() looks like it could work for some USB-serial
drivers, others definitely do not expect this, so modelling this after
serial core is going to be intrusive, if at all possible.

Instead, use a (renamed) tty helper to save the termios data used at
console setup so that the tty termios reflects the actual terminal
settings after a subsequent tty open().

Note that the calls to tty_init_termios() (tty_driver_install()) and
tty_save_termios() are serialised using the disconnect mutex.

This specifically fixes a regression that was triggered by a recent
change adding software flow control to the pl2303 driver: a getty trying
to disable flow control while leaving the baud rate unchanged would now
also set the baud rate to the driver default (prior to the flow-control
change this had been a noop).

Fixes: 7041d9c3f0 ("USB: serial: pl2303: add support for tx xon/xoff flow control")
Cc: stable <stable@vger.kernel.org>	# 4.18
Cc: Florian Zumbiehl <florz@florz.de>
Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2018-12-05 11:29:10 +01:00
..
aircable.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
ark3116.c ark3116: switch to ->get_serial() 2018-10-13 00:50:35 -04:00
belkin_sa.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
belkin_sa.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
bus.c USB: serial: use tty_port_register_device() 2018-05-17 11:22:00 +02:00
ch341.c USB: serial: ch341: fix type promotion bug in ch341_control_in() 2018-07-04 15:40:54 +02:00
console.c USB: serial: console: fix reported terminal settings 2018-12-05 11:29:10 +01:00
cp210x.c USB-serial updates for v4.19-rc1 2018-07-20 21:47:15 +02:00
cyberjack.c USB: serial: cyberjack: use irqsave() in USB's complete callback 2018-06-26 14:13:53 +02:00
cypress_m8.c USB: serial: cypress_m8: remove set but not used variable 'iflag' 2018-10-05 08:58:42 +02:00
cypress_m8.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
digi_acceleport.c USB: serial: digi_acceleport: rename tty flag variable 2018-06-27 07:59:03 +02:00
empeg.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
ezusb_convert.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
f81232.c f81232: switch to ->get_serial() 2018-10-13 00:50:35 -04:00
f81534.c f81534: switch to ->get_serial() 2018-10-13 00:50:36 -04:00
ftdi_sio.c USB/PHY patches for 4.20-rc1 2018-10-26 08:14:13 -07:00
ftdi_sio.h USB: serial: ftdi_sio: add support for FT232R CBUS gpios 2018-10-05 08:57:06 +02:00
ftdi_sio_ids.h Revert "USB: serial: ftdi_sio: add Id for Physik Instrumente E-870" 2018-03-29 18:37:28 +02:00
garmin_gps.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
generic.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
io_16654.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
io_edgeport.c io_edgeport: switch to ->get_serial() 2018-10-13 00:50:37 -04:00
io_edgeport.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
io_ionsp.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
io_ti.c io_ti: switch to ->get_serial() 2018-10-13 00:50:38 -04:00
io_ti.h USB: serial: io_ti: fix array underflow in completion handler 2018-08-27 11:52:34 +02:00
io_usbvend.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ipaq.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ipw.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ir-usb.c USB: serial: cast sizeof() to int when comparing with error code 2018-06-25 10:34:31 +02:00
iuu_phoenix.c USB: serial: iuu_phoenix: drop redundant input-speed re-encoding 2018-07-16 14:12:11 +02:00
iuu_phoenix.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
Kconfig USB: serial: simple: add libtransistor console 2018-04-16 09:19:53 +02:00
keyspan.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
keyspan_pda.c USB: serial: keyspan_pda: fix modem-status error handling 2018-07-06 10:32:14 +02:00
keyspan_usa26msg.h
keyspan_usa28msg.h
keyspan_usa49msg.h
keyspan_usa67msg.h
keyspan_usa90msg.h
kl5kusb105.c USB: serial: kl5kusb105: remove KLSI device id 2018-07-11 10:11:29 +02:00
kl5kusb105.h USB: serial: kl5kusb105: remove KLSI device id 2018-07-11 10:11:29 +02:00
kobil_sct.c USB: serial: kobil_sct: add missing version error handling 2018-07-06 10:42:42 +02:00
kobil_sct.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile-keyspan_pda_fw USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
mct_u232.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
mct_u232.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
metro-usb.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
mos7720.c mos7720: switch to ->get_serial() 2018-10-13 00:50:38 -04:00
mos7840.c mos7840: switch to ->get_serial() 2018-10-13 00:50:39 -04:00
mxuport.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
navman.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
omninet.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
opticon.c opticon: switch to ->get_serial() 2018-10-13 00:50:39 -04:00
option.c Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-10-24 14:43:41 +01:00
oti6858.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
oti6858.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
pl2303.c pl2303: switch to ->get_serial() 2018-10-13 00:50:40 -04:00
pl2303.h USB: serial: pl2303: add a new device id for ATEN 2018-08-02 10:37:04 +02:00
qcaux.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
qcserial.c USB: serial: qcserial: add Sierra Wireless EM7565 2017-12-15 09:41:46 +01:00
quatech2.c quatech2: switch to ->get_serial() 2018-10-13 00:50:40 -04:00
safe_serial.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
sierra.c USB: serial: sierra: use irqsave() in USB's complete callback 2018-06-26 15:22:25 +02:00
spcp8x5.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ssu100.c ssu100: switch to ->get_serial() 2018-10-13 00:50:41 -04:00
symbolserial.c USB: serial: symbolserial: use irqsave() in USB's complete callback 2018-06-26 15:25:01 +02:00
ti_usb_3410_5052.c Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-10-24 14:43:41 +01:00
upd78f0730.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
usb-serial-simple.c USB: serial: simple: add Motorola Tetra MTP6550 id 2018-09-24 15:30:16 +02:00
usb-serial.c complete ->[sg]et_serial() switchover 2018-10-13 00:50:43 -04:00
usb-wwan.h usb_wwan: switch to ->[sg]et_serial() 2018-10-13 00:50:42 -04:00
usb_debug.c USB: serial: usb_debug: add new USB device id 2017-11-28 09:54:11 +01:00
usb_wwan.c usb_wwan: switch to ->[sg]et_serial() 2018-10-13 00:50:42 -04:00
visor.c USB: serial: visor: handle potential invalid device configuration 2018-05-02 09:37:19 +02:00
visor.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
whiteheat.c whiteheat: switch to ->get_serial() 2018-10-13 00:50:42 -04:00
whiteheat.h USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
wishbone-serial.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
xsens_mt.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00