All of lore.kernel.org
 help / color / mirror / Atom feed
* CH341 driver and the 5.4 kernel
@ 2021-07-07  7:33 Jeffrey Walton
  2021-07-07  7:41 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jeffrey Walton @ 2021-07-07  7:33 UTC (permalink / raw)
  To: linux-usb

Hi Everyone,

I'm trying to track down the cause of some garbage in a response when
using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
CH341 serial controller.

I see there's been a fair amount of activity with the CH341
(https://github.com/torvalds/linux/commits/master/drivers/usb/serial/ch341.c),
but I can't tell if its been backported to the 5.4 kernel.
Specifically, the 5.4.0-77 kernel supplied with Ubuntu 18.04 and Mint
20.1.

Does anyone know if the fixes and improvements for the CH341 have made
their way into the 5.4 kernel?

Thanks in advance.

Jeff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07  7:33 CH341 driver and the 5.4 kernel Jeffrey Walton
@ 2021-07-07  7:41 ` Greg KH
  2021-07-07  7:56   ` Jeffrey Walton
  2021-07-07 14:45 ` Alan Stern
  2021-07-07 21:48 ` Jeffrey Walton
  2 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2021-07-07  7:41 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: linux-usb

On Wed, Jul 07, 2021 at 03:33:52AM -0400, Jeffrey Walton wrote:
> Hi Everyone,
> 
> I'm trying to track down the cause of some garbage in a response when
> using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
> CH341 serial controller.
> 
> I see there's been a fair amount of activity with the CH341
> (https://github.com/torvalds/linux/commits/master/drivers/usb/serial/ch341.c),
> but I can't tell if its been backported to the 5.4 kernel.
> Specifically, the 5.4.0-77 kernel supplied with Ubuntu 18.04 and Mint
> 20.1.

Who knows what has been backported to random vendor kernels like this :)

Look at the source and see!

> Does anyone know if the fixes and improvements for the CH341 have made
> their way into the 5.4 kernel?

What specific commit are you looking for?

And if you want to use this device, why not use a much more modern
kernel release?  5.4 is quite old for new hardware to be using, does
5.13 work properly for you?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07  7:41 ` Greg KH
@ 2021-07-07  7:56   ` Jeffrey Walton
  2021-07-07 10:46     ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Jeffrey Walton @ 2021-07-07  7:56 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb

> > Does anyone know if the fixes and improvements for the CH341 have made
> > their way into the 5.4 kernel?
>
> What specific commit are you looking for?

Well, I'm not really looking for a specific commit. I'm just trying to
verify the various fixes are present in the kernel.

> And if you want to use this device, why not use a much more modern
> kernel release?  5.4 is quite old for new hardware to be using, does
> 5.13 work properly for you?

My bad, I thought 5.4 was a LTS kernel. The docs I read said it was
released November 2019 and supported until 2026.

I'll try something newer. It looks like these are available:

    5.4.0, 5.6.0, 5.8.0, 5.10.0, 5.11.0

Jeff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07  7:56   ` Jeffrey Walton
@ 2021-07-07 10:46     ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-07-07 10:46 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: linux-usb

On Wed, Jul 07, 2021 at 03:56:10AM -0400, Jeffrey Walton wrote:
> > > Does anyone know if the fixes and improvements for the CH341 have made
> > > their way into the 5.4 kernel?
> >
> > What specific commit are you looking for?
> 
> Well, I'm not really looking for a specific commit. I'm just trying to
> verify the various fixes are present in the kernel.

What specific fixes are you looking for?

> > And if you want to use this device, why not use a much more modern
> > kernel release?  5.4 is quite old for new hardware to be using, does
> > 5.13 work properly for you?
> 
> My bad, I thought 5.4 was a LTS kernel. The docs I read said it was
> released November 2019 and supported until 2026.

It is, but it is supported for the features that were present in the
5.4.0 release, nothing new is added.

> I'll try something newer. It looks like these are available:
> 
>     5.4.0, 5.6.0, 5.8.0, 5.10.0, 5.11.0

Why not try a kernel.org kernel?  If you are stuck with distro kernel,
please ask for support from them as they are the only ones that can do
anything with their kernel tree.

good luck!

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07  7:33 CH341 driver and the 5.4 kernel Jeffrey Walton
  2021-07-07  7:41 ` Greg KH
@ 2021-07-07 14:45 ` Alan Stern
  2021-07-07 21:55   ` Jeffrey Walton
  2021-07-07 21:48 ` Jeffrey Walton
  2 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2021-07-07 14:45 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: linux-usb

On Wed, Jul 07, 2021 at 03:33:52AM -0400, Jeffrey Walton wrote:
> Hi Everyone,
> 
> I'm trying to track down the cause of some garbage in a response when
> using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
> CH341 serial controller.
> 
> I see there's been a fair amount of activity with the CH341
> (https://github.com/torvalds/linux/commits/master/drivers/usb/serial/ch341.c),
> but I can't tell if its been backported to the 5.4 kernel.
> Specifically, the 5.4.0-77 kernel supplied with Ubuntu 18.04 and Mint
> 20.1.
> 
> Does anyone know if the fixes and improvements for the CH341 have made
> their way into the 5.4 kernel?

If you're talking about the 5.4.y kernels from kernel.org (as opposed 
to the kernels supplied by Ubuntu, which might have goodness knows 
what in them), you can see for yourself easily enough:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/usb/serial/ch341.c?h=linux-5.4.y

Alan Stern

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07  7:33 CH341 driver and the 5.4 kernel Jeffrey Walton
  2021-07-07  7:41 ` Greg KH
  2021-07-07 14:45 ` Alan Stern
@ 2021-07-07 21:48 ` Jeffrey Walton
  2021-07-08  6:17   ` Greg KH
  2 siblings, 1 reply; 8+ messages in thread
From: Jeffrey Walton @ 2021-07-07 21:48 UTC (permalink / raw)
  To: linux-usb

> I'm trying to track down the cause of some garbage in a response when
> using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
> CH341 serial controller.

To follow up on this...

Here's the device I am working with: OBD2 Scanner Adapter OBD2 ELM327
USB Cable Car Code Reader Diagnostic Scan Tool v1.5,
https://www.amazon.com/gp/product/B0897G6BMZ. It has a controller for
interfacing with a vehicle's OBD II, and a CH340 for USB
communications.

I contacted ELM Electronics Support [1] about the garbage I was
seeing. I thought I may have the serial port misconfigured in a subtle
way. Support wrote back that they did not make the OBD controller in a
v1.5. They make, among others, v1.4b and v2.0 [2]. It appears the OBD
chip is a knockoff.

I also think I tracked down the vendor for the CH340. It is a company
called WCH. It looks like they provide a GPL'd driver for Linux [3]
and name the driver ch34x. The driver is a lot different than the one
provided by the Linux kernel [4].

What I don't know is, if the WCH serial controller is another
knock-off. If it is an ill-performing knock-off, then that may explain
the problems using the existing Linux driver. Using the WCH driver
probably explains why things work under Windows. The WCH driver may
fix the problems I am seeing under Linux.

Jeff

[1] https://www.elmelectronics.com/ic/elm327/
[2] https://www.elmelectronics.com/wp-content/uploads/2020/05/AT_Command_Table.pdf
[3] http://wch-ic.com/downloads/CH341SER_LINUX_ZIP.html
[4] https://github.com/torvalds/linux/blob/master/drivers/usb/serial/ch341.c

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07 14:45 ` Alan Stern
@ 2021-07-07 21:55   ` Jeffrey Walton
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Walton @ 2021-07-07 21:55 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-usb

On Wed, Jul 7, 2021 at 10:45 AM Alan Stern <stern@rowland.harvard.edu> wrote:
>
> On Wed, Jul 07, 2021 at 03:33:52AM -0400, Jeffrey Walton wrote:
> > Hi Everyone,
> >
> > I'm trying to track down the cause of some garbage in a response when
> > using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
> > CH341 serial controller.
> >
> > I see there's been a fair amount of activity with the CH341
> > (https://github.com/torvalds/linux/commits/master/drivers/usb/serial/ch341.c),
> > but I can't tell if its been backported to the 5.4 kernel.
> > Specifically, the 5.4.0-77 kernel supplied with Ubuntu 18.04 and Mint
> > 20.1.
> >
> > Does anyone know if the fixes and improvements for the CH341 have made
> > their way into the 5.4 kernel?
>
> If you're talking about the 5.4.y kernels from kernel.org (as opposed
> to the kernels supplied by Ubuntu, which might have goodness knows
> what in them), you can see for yourself easily enough:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/usb/serial/ch341.c?h=linux-5.4.y

Thanks Alan.

As far as I know, Ubuntu uses -oem kernels that track upstream. All
upstream changes should be merged into Ubuntu's gear. Also see
https://wiki.ubuntu.com/Kernel/OEMKernel.

Jeff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CH341 driver and the 5.4 kernel
  2021-07-07 21:48 ` Jeffrey Walton
@ 2021-07-08  6:17   ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-07-08  6:17 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: linux-usb

On Wed, Jul 07, 2021 at 05:48:48PM -0400, Jeffrey Walton wrote:
> > I'm trying to track down the cause of some garbage in a response when
> > using an ELM327 (https://www.elmelectronics.com/ic/elm327/) with a
> > CH341 serial controller.
> 
> To follow up on this...
> 
> Here's the device I am working with: OBD2 Scanner Adapter OBD2 ELM327
> USB Cable Car Code Reader Diagnostic Scan Tool v1.5,
> https://www.amazon.com/gp/product/B0897G6BMZ. It has a controller for
> interfacing with a vehicle's OBD II, and a CH340 for USB
> communications.
> 
> I contacted ELM Electronics Support [1] about the garbage I was
> seeing. I thought I may have the serial port misconfigured in a subtle
> way. Support wrote back that they did not make the OBD controller in a
> v1.5. They make, among others, v1.4b and v2.0 [2]. It appears the OBD
> chip is a knockoff.
> 
> I also think I tracked down the vendor for the CH340. It is a company
> called WCH. It looks like they provide a GPL'd driver for Linux [3]
> and name the driver ch34x. The driver is a lot different than the one
> provided by the Linux kernel [4].
> 
> What I don't know is, if the WCH serial controller is another
> knock-off. If it is an ill-performing knock-off, then that may explain
> the problems using the existing Linux driver. Using the WCH driver
> probably explains why things work under Windows. The WCH driver may
> fix the problems I am seeing under Linux.

If you could try the latest 5.13 kernel release to let us know if that
solves the issues for you or not, that would be great as a lot of work
has recently gone in for these "odd" ch340-like devices.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-08  6:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  7:33 CH341 driver and the 5.4 kernel Jeffrey Walton
2021-07-07  7:41 ` Greg KH
2021-07-07  7:56   ` Jeffrey Walton
2021-07-07 10:46     ` Greg KH
2021-07-07 14:45 ` Alan Stern
2021-07-07 21:55   ` Jeffrey Walton
2021-07-07 21:48 ` Jeffrey Walton
2021-07-08  6:17   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.