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>
[bwh: Backported to 3.2:
- Adjust context
- Keep the 'serial' variable in ch341_open()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>