Thread (1 message) 1 message, 1 author, 2021-09-20

Re: Possible bug in the cp210x kernel driver?

From: Johan Hovold <johan@kernel.org>
Date: 2021-09-20 08:10:49

[ Adding linux-usb on CC ]

On Sat, Sep 18, 2021 at 03:49:22PM +0200, Malte Bayer wrote:
Hello Johan,

I recently had a problem with libdivecomputer fetching a specific dive
log. After debugging the issue I tracked the problem down to the
cp210x kernel driver.

Last year, you submitted a change for "Line status events"
https://github.com/torvalds/linux/commit/a7207e9835a4f245c8c693170906fda0980273f3The

 connection to my mares puck pro is established with even parity.
Every time, the dive computer sends the byte pair 0xEC 0x00 (which in
my case is valid transmitted data from the connected device to the
pc), the 0x00 after the 0xEC gets dropped by the driver.

For reference, please take a look on https://github.com/libdivecomputer/libdivecomputer/issues/22#issuecomment-922067186
and jefdriesen's answer.

libdivecomputer does raw reads of binary data - therefore I dont think
that it's a good idea to manipulate the received data stream?
Thanks for the report.

In event mode the device is supposed to replace any '0xec' characters
in the input stream with the string '0xec 0x00', which the driver then
needs to convert back to '0xec'.

But clearly your device doesn't escape '0xec' as expected.

What type of cp210x are you using?

As you already discovered you can disable input parity checking (INPCK)
as a workaround meanwhile.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help