stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Aidan Thornton <makosoft@gmail.com>
Cc: Johan Hovold <johan@kernel.org>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>,
	Grigori Goronzy <greg@chown.ath.cx>,
	Karl Palsson <karlp@tweak.net.au>,
	Russell Senior <russell@personaltelco.net>,
	Eddi De Pieri <eddi@depieri.net>, stable <stable@vger.kernel.org>
Subject: Re: [PATCH 06/13] USB: serial: ch341: fix initial line settings
Date: Fri, 16 Dec 2016 15:46:14 +0100	[thread overview]
Message-ID: <20161216144614.GB21690@localhost> (raw)
In-Reply-To: <CAB=c7TqLVYX-52WGSn4CAbx8MCVS7uSOjuKGbEJ6Yon83YJQdw@mail.gmail.com>

On Fri, Dec 16, 2016 at 01:19:05PM +0000, Aidan Thornton wrote:
> On Wed, Dec 14, 2016 at 3:28 PM, Johan Hovold <johan@kernel.org> wrote:
> > The ch341 driver is based on reverse-engineering and contains some bits
> > which appear to be redundant and some which appear incompatible which
> > certain devices.
> >
> > Specifically, some CH340 devices seem unable to change the initial line
> > settings, which have so far been set to 5N1. Let's use a more reasonable
> > 8N1 default instead.
> >
> > Note that we also need to set the ENABLE_RX bit or receive will be
> > disabled after a reset during resume.
> 
> Lost track a little of the testing, but I don't think you ever got
> Russel to test whether this worked using a driver that tried to change
> this through direct register writes which seem to be the only thing
> that has any effect on this strange hardware variant. Would be a
> little surprised if it didn't at this point - changing the line
> settings that way after initialization certainly works well enough to
> cause us all a headache.

I believe he did test this against my usb-linus branch, which did not
have your recent changes. IIRC both removing that first LCR write and
changing it to 0xc3 worked, but maybe you're right and we only verified
removing it.

In the same setup, changing the word size after successful
initialisation using direct register writes did not work however, and
the device appeared stuck at 5N1 or 8N1 depending on if the initial 0x50
LCR write was left in or not.

> If so, I suggest it might be clearer to drop this patch altogether in
> favour of patch 10 in the series, since the underlying problem is that
> setting the baudrate and LCR register didn't work and patch 10 fixes
> that.

These two patches are definitely related, and I struggled a bit about
how to order things as I wanted to find a way to backport this minimal
change (from 5N1 to 8N1) without having to depend on the upcoming
changes in 4.10 (your changes) as that may be enough to enable support
in older kernels.

I'll respin this, once we learn more about how those quirky devices
work.

Thanks,
Johan

  reply	other threads:[~2016-12-16 14:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20161214152810.14682-1-johan@kernel.org>
2016-12-14 15:27 ` [PATCH 01/13] USB: serial: ch341: fix initial modem-control state Johan Hovold
2016-12-14 15:27 ` [PATCH 02/13] USB: serial: ch341: fix open and resume after B0 Johan Hovold
2016-12-14 15:28 ` [PATCH 03/13] USB: serial: ch341: fix modem-control and B0 handling Johan Hovold
2016-12-14 15:28 ` [PATCH 04/13] USB: serial: ch341: fix open error handling Johan Hovold
2016-12-14 15:28 ` [PATCH 05/13] USB: serial: ch341: fix resume after reset Johan Hovold
2016-12-14 15:28 ` [PATCH 06/13] USB: serial: ch341: fix initial line settings Johan Hovold
2016-12-16 13:19   ` Aidan Thornton
2016-12-16 14:46     ` Johan Hovold [this message]
2016-12-16 16:04       ` Russell Senior
2016-12-16 16:13         ` Johan Hovold
2016-12-16 17:30           ` Johan Hovold
2016-12-17 11:27             ` Russell Senior
2016-12-19 10:58               ` Johan Hovold
2016-12-19 16:40                 ` Russell Senior
2016-12-19 22:12                   ` Russell Senior
2016-12-20  9:13                     ` Johan Hovold
2016-12-20 12:38                       ` Russell Senior
2016-12-20 16:07                         ` Johan Hovold
2016-12-20 16:13                           ` Johan Hovold
2016-12-20 20:09                           ` Russell Senior
2016-12-20 20:49                             ` Johan Hovold
2017-01-09 13:51                               ` Johan Hovold
2017-01-12 14:49                                 ` Johan Hovold
2016-12-20 15:31                       ` Russell Senior
2016-12-20 15:52                         ` Johan Hovold
2016-12-20 20:05                           ` Russell Senior
2016-12-20  8:42                   ` Johan Hovold

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=20161216144614.GB21690@localhost \
    --to=johan@kernel.org \
    --cc=eddi@depieri.net \
    --cc=greg@chown.ath.cx \
    --cc=karlp@tweak.net.au \
    --cc=linux-usb@vger.kernel.org \
    --cc=makosoft@gmail.com \
    --cc=russell@personaltelco.net \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).