]> git.baikalelectronics.ru Git - kernel.git/commit
USB: pl2303: fix data corruption on termios updates
authorJohan Hovold <jhovold@gmail.com>
Sun, 29 Dec 2013 18:22:53 +0000 (19:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jan 2014 20:31:46 +0000 (12:31 -0800)
commit1b536bc9779346a640f9bb54fd2e231cfcb0446d
treeca59cfc957ff24d174401c32d12ece3701bf01d1
parent2991bc9fadacdeb076aec8913e251a7f80c3294c
USB: pl2303: fix data corruption on termios updates

Some PL2303 devices are known to lose bytes if you change serial
settings even to the same values as before. Avoid this by comparing the
encoded settings with the previsouly used ones before configuring the
device.

The common case was fixed by commit c03386e3e6c83 ("pl2303: Fix mode
switching regression"), but this problem was still possible to trigger,
for instance, by using the TCSETS2-interface to repeatedly request
115201 baud, which gets mapped to 115200 and thus always triggers a
settings update.

Cc: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/pl2303.c