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

On Tue, Dec 20, 2016 at 05:07:48PM +0100, Johan Hovold wrote:
> On Tue, Dec 20, 2016 at 04:38:19AM -0800, Russell Senior wrote:
> > > I'm not sure what device we're dealing with here, but it seems it would
> > > not be supported by the vendor (whose version of this driver also uses
> > > the init-command).
> > >
> > > Perhaps you could give the attached vendor driver a quick spin just to
> > > confirm that? It's a rebased version against usb-next.
> > >
> > > I've also pushed a commit that tries to dump the registers differently
> > > (reading together with register 0x25):
> > >
> > >         3baa1eff4245 ("dbg: ch341: dump registers differently")
> > 
> > 00019-g3baa1ef:
> > 
> > Dec 20 04:30:50 willard kernel: usbcore: registered new interface driver ch341
> > Dec 20 04:30:50 willard kernel: usbserial: USB Serial support
> > registered for ch341-uart
> > Dec 20 04:31:14 willard kernel: usb 6-2: new full-speed USB device
> > number 11 using uhci_hcd
> > Dec 20 04:31:14 willard kernel: usb 6-2: New USB device found,
> > idVendor=1a86, idProduct=7523
> > Dec 20 04:31:14 willard kernel: usb 6-2: New USB device strings:
> > Mfr=0, Product=2, SerialNumber=0
> > Dec 20 04:31:14 willard kernel: usb 6-2: Product: USB2.0-Ser!
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: ch341-uart converter detected
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: [00] = 00
> 
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: [17] = 00
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: [18] = c3
> 
> Ok, so the device only returns the value of the LCR when read together
> with 0x25. Otherwise all zero.
> 
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: write 0x31 0xb282
> 
> > Dec 20 04:31:14 willard kernel: ch341 6-2:1.0: [18] = f1
> 
> And as before it it looks to be updated correctly through a direct
> write, even though tx_en and rx_en is always set.
> 
> My guess is this is some CH341 clone that mimics the behaviour of some
> version of the chip, especially as the vendor does not seem to bother to
> support it (unless it's a new version?).

Then again, if the vendor driver for another OS works, they at least do
care about those users. Perhaps someone can trace what a recent driver
does when encountering these devices.

> I think sticking to using the init command for all devices, except when
> detecting a device that fails to read the divisor registers and then
> fall back to direct writes might be the way forward. That way, we'd
> have some minimal support for these devices at least.
> 
> Perhaps we should determine what else is working or broken first,
> though.
> 
> Russel, could you test if break-signalling works, and if the
> modem-control signals (DTR/RTS) are asserted at open? Do you get any
> interrupts when the modem-status changes (e.g. remote end hangs up --
> there should be debug messages)?
> 
> Any other suggestions?
 
Thanks,
Johan

  reply	other threads:[~2016-12-20 16:13 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
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 [this message]
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=20161220161333.GC8189@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).