USB: serial: cp210x: fix CP2102N-A01 modem control
authorJohan Hovold <johan@kernel.org>
Wed, 9 Jun 2021 16:15:09 +0000 (18:15 +0200)
committerJohan Hovold <johan@kernel.org>
Thu, 10 Jun 2021 14:59:00 +0000 (16:59 +0200)
commit63a8eef70ccb5199534dec56fed9759d214bfe55
treeb5364b205cb7e7b88f4e2da6867c91dfa446e49a
parent6f7ec77cc8b64ff5037c1945e4650c65c458037d
USB: serial: cp210x: fix CP2102N-A01 modem control

CP2102N revision A01 (firmware version <= 1.0.4) has a buggy
flow-control implementation that uses the ulXonLimit instead of
ulFlowReplace field of the flow-control settings structure (erratum
CP2102N_E104).

A recent change that set the input software flow-control limits
incidentally broke RTS control for these devices when CRTSCTS is not set
as the new limits would always enable hardware flow control.

Fix this by explicitly disabling flow control for the buggy firmware
versions and only updating the input software flow-control limits when
IXOFF is requested. This makes sure that the terminal settings matches
the default zero ulXonLimit (ulFlowReplace) for these devices.

Link: https://lore.kernel.org/r/20210609161509.9459-1-johan@kernel.org
Reported-by: David Frey <dpfrey@gmail.com>
Reported-by: Alex Villacís Lasso <a_villacis@palosanto.com>
Tested-by: Alex Villacís Lasso <a_villacis@palosanto.com>
Fixes: f61309d9c96a ("USB: serial: cp210x: set IXOFF thresholds")
Cc: stable@vger.kernel.org # 5.12
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c