USB: serial: ch341: fix modem-status handling
authorJohan Hovold <johan@kernel.org>
Fri, 6 Jan 2017 18:15:17 +0000 (19:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 May 2017 12:08:26 +0000 (14:08 +0200)
commit1077176a2456691525a02a666e9d1d24447341f7
tree4d9263a1d8f5b93cc624e855db40249fb75871f9
parente40bbb3970749d490af2c2d52de496e85f810ea1
USB: serial: ch341: fix modem-status handling

commit a0467a967f347842b30739aae636c44980265265 upstream.

The modem-status register was read as part of device configuration at
port_probe and then again at open (and reset-resume). During open (and
reset-resume) the MSR was read before submitting the interrupt URB,
something which could lead to an MSR-change going unnoticed when it
races with open (reset-resume).

Fix this by dropping the redundant reconfiguration of the port at every
open, and only read the MSR after the interrupt URB has been submitted.

Fixes: 664d5df92e88 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ch341.c