mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
pl2303: Fix mode switching regression
Cleaning out all the incorrect 'no change made' checks for termios settings showed up a problem with the PL2303. The hardware here seems to lose sync and bits if you tell it to make no changes. This shows up with a real world application. To fix this the driver check for meaningful hardware changes is restored but doing the tests correctly and as a tty layer function so it doesn't get duplicated wrongly everywhere if other drivers turn out to need it. Signed-off-by: Alan Cox <[email protected]> Tested-by: Mirko Parthey <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
cf05946250
commit
bf5e5834bf
3 changed files with 27 additions and 0 deletions
|
|
@ -483,6 +483,13 @@ static void pl2303_set_termios(struct usb_serial_port *port,
|
|||
}
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
|
||||
/* The PL2303 is reported to lose bytes if you change
|
||||
serial settings even to the same values as before. Thus
|
||||
we actually need to filter in this specific case */
|
||||
|
||||
if (!tty_termios_hw_change(port->tty->termios, old_termios))
|
||||
return;
|
||||
|
||||
cflag = port->tty->termios->c_cflag;
|
||||
|
||||
buf = kzalloc(7, GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue