From: Johan Hovold <johan@kernel.org>
To: "Alex Villacís Lasso" <a_villacis@palosanto.com>
Cc: David Frey <dpfrey@gmail.com>,
linux-usb@vger.kernel.org, Pho Tran <pho.tran@silabs.com>,
Tung Pham <tung.pham@silabs.com>,
Hung.Nguyen@silabs.com, stable@vger.kernel.org
Subject: Re: [PATCH] USB: serial: cp210x: fix CP2102N-A01 modem control
Date: Thu, 10 Jun 2021 09:23:49 +0200 [thread overview]
Message-ID: <YMG+Be220/sZ4QIC@hovoldconsulting.com> (raw)
In-Reply-To: <22113673-a359-f783-166f-acbe5dbc9298@palosanto.com>
On Wed, Jun 09, 2021 at 12:00:36PM -0500, Alex Villacís Lasso wrote:
> El 9/6/21 a las 11:15, Johan Hovold escribió:
> > 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.
> >
> > Reported-by: David Frey <dpfrey@gmail.com>
> > Reported-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 | 64 ++++++++++++++++++++++++++++++++++---
> > 1 file changed, 59 insertions(+), 5 deletions(-)
> >
> > David and Alex,
> >
> > Would you mind testing this one with your CP2108N-A01? I've verified it
> > against a CP2108N-A02 (fw 1.0.8) here.
I meant CP2102N here of course. It had been a long day...
> Applied patch and tested with ESP32 board under kernel 5.12.9:
> jun 09 11:56:00 karlalex-asus kernel: cp210x 1-9:1.0:
> cp210x_get_fw_version - 1.0.4
> $ miniterm.py /dev/ttyUSB0 115200
> <successful connect>
>
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_change_speed - setting baud rate to 9600
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_set_flow_control - ctrl = 0x00, flow = 0x00
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_tiocmset_port - control = 0x0303
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_change_speed - setting baud rate to 115384
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_tiocmset_port - control = 0x0101
> jun 09 11:56:50 karlalex-asus kernel: cp210x ttyUSB0:
> cp210x_tiocmset_port - control = 0x0202
>
> At least in my case, this patch fixes the regression for my workflow.
Thanks for confirming. Can I add a "Tested-by" tag for you as well?
And again, thanks for the detailed report, bisection and thorough
testing throughout.
Johan
next prev parent reply other threads:[~2021-06-10 7:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YL87Na0MycRA6/fW@hovoldconsulting.com>
2021-06-09 16:15 ` [PATCH] USB: serial: cp210x: fix CP2102N-A01 modem control Johan Hovold
2021-06-09 17:00 ` Alex Villacís Lasso
2021-06-10 7:23 ` Johan Hovold [this message]
2021-06-10 14:55 ` Alex Villacís Lasso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YMG+Be220/sZ4QIC@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Hung.Nguyen@silabs.com \
--cc=a_villacis@palosanto.com \
--cc=dpfrey@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=pho.tran@silabs.com \
--cc=stable@vger.kernel.org \
--cc=tung.pham@silabs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox