<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/serial/ch341.c, branch linux-5.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-08-25T07:13:33Z</updated>
<entry>
<title>Revert "USB: serial: ch341: fix character loss at high transfer rates"</title>
<updated>2021-08-25T07:13:33Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2021-08-24T12:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df7b16d1c00ecb3da3a30c999cdb39f273c99a2f'/>
<id>urn:sha1:df7b16d1c00ecb3da3a30c999cdb39f273c99a2f</id>
<content type='text'>
This reverts commit 3c18e9baee0ef97510dcda78c82285f52626764b.

These devices do not appear to send a zero-length packet when the
transfer size is a multiple of the bulk-endpoint max-packet size. This
means that incoming data may not be processed by the driver until a
short packet is received or the receive buffer is full.

Revert back to using endpoint-sized receive buffers to avoid stalled
reads.

Reported-by: Paul Größel &lt;pb.g@gmx.de&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214131
Fixes: 3c18e9baee0e ("USB: serial: ch341: fix character loss at high transfer rates")
Cc: stable@vger.kernel.org
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20210824121926.19311-1-johan@kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: fix character loss at high transfer rates</title>
<updated>2021-07-29T11:52:10Z</updated>
<author>
<name>Willy Tarreau</name>
</author>
<published>2021-07-24T15:27:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c18e9baee0ef97510dcda78c82285f52626764b'/>
<id>urn:sha1:3c18e9baee0ef97510dcda78c82285f52626764b</id>
<content type='text'>
The chip supports high transfer rates, but with the small default buffers
(64 bytes read), some entire blocks are regularly lost. This typically
happens at 1.5 Mbps (which is the default speed on Rockchip devices) when
used as a console to access U-Boot where the output of the "help" command
misses many lines and where "printenv" mangles the environment.

The FTDI driver doesn't suffer at all from this. One difference is that
it uses 512 bytes rx buffers and 256 bytes tx buffers. Adopting these
values completely resolved the issue, even the output of "dmesg" is
reliable. I preferred to leave the Tx value unchanged as it is not
involved in this issue, while a change could increase the risk of
triggering the same issue with other devices having too small buffers.

I verified that it backports well (and works) at least to 5.4. It's of
low importance enough to be dropped where it doesn't trivially apply
anymore.

Cc: stable@vger.kernel.org
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20210724152739.18726-1-w@1wt.eu
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: add new Product ID</title>
<updated>2021-03-09T08:05:36Z</updated>
<author>
<name>Niv Sardi</name>
</author>
<published>2021-03-01T20:16:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5563b3b6420362c8a1f468ca04afe6d5f0a8d0a3'/>
<id>urn:sha1:5563b3b6420362c8a1f468ca04afe6d5f0a8d0a3</id>
<content type='text'>
Add PID for CH340 that's found on cheap programmers.

The driver works flawlessly as soon as the new PID (0x9986) is added to it.
These look like ANU232MI but ship with a ch341 inside. They have no special
identifiers (mine only has the string "DB9D20130716" printed on the PCB and
nothing identifiable on the packaging. The merchant i bought it from
doesn't sell these anymore).

the lsusb -v output is:
Bus 001 Device 009: ID 9986:7523
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x9986
  idProduct          0x7523
  bcdDevice            2.54
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               96mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1
      bInterfaceProtocol      2
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1

Signed-off-by: Niv Sardi &lt;xaiki@evilgiggle.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: make remove callback return void</title>
<updated>2021-02-09T12:13:58Z</updated>
<author>
<name>Uwe Kleine-König</name>
</author>
<published>2021-02-08T14:31:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5d1448fa353242635fa3e1fed6ab4558e0e7d9a'/>
<id>urn:sha1:c5d1448fa353242635fa3e1fed6ab4558e0e7d9a</id>
<content type='text'>
All usb_serial drivers return 0 in their remove callbacks and driver
core ignores the value returned by usb_serial_device_remove(). So change
the remove callback to return void and return 0 unconditionally in
usb_serial_device_remove().

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Link: https://lore.kernel.org/r/20210208143149.963644-2-uwe@kleine-koenig.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: sort device-id entries</title>
<updated>2020-12-03T09:28:55Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2020-12-03T09:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf193bfc12dbc3754fc8a6e0e1e3702f1af2f772'/>
<id>urn:sha1:bf193bfc12dbc3754fc8a6e0e1e3702f1af2f772</id>
<content type='text'>
Keep the device-id entries sorted to make it easier to add new ones in
the right spot.

Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: add new Product ID for CH341A</title>
<updated>2020-12-03T09:09:45Z</updated>
<author>
<name>Jan-Niklas Burfeind</name>
</author>
<published>2020-12-03T03:03:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63'/>
<id>urn:sha1:46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63</id>
<content type='text'>
Add PID for CH340 that's found on a ch341 based Programmer made by keeyees.
The specific device that contains the serial converter is described
here: http://www.keeyees.com/a/Products/ej/36.html

The driver works flawlessly as soon as the new PID (0x5512) is added to
it.

Signed-off-by: Jan-Niklas Burfeind &lt;kernel@aiyionpri.me&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'usb-serial-5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next</title>
<updated>2020-07-28T15:33:10Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2020-07-28T15:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa56dd9152ef955bd21082c5330e4dff8621bca6'/>
<id>urn:sha1:fa56dd9152ef955bd21082c5330e4dff8621bca6</id>
<content type='text'>
Johan writes:

USB-serial updates for 5.9-rc1

Here are the USB-serial updates for 5.9-rc1, including:

 - console flow-control support
 - simulated line-breaks on some ch341
 - hardware flow-control fixes for cp210x
 - break-detection and sysrq fixes for ftdi_sio
 - sysrq optimisations
 - input parity checking for cp210x

Included are also some new device ids and various clean ups.

All have been in linux-next with no reported issues.

* tag 'usb-serial-5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (31 commits)
  USB: serial: qcserial: add EM7305 QDL product ID
  USB: serial: iuu_phoenix: fix led-activity helpers
  USB: serial: sierra: clean up special-interface handling
  USB: serial: cp210x: use in-kernel types in port data
  USB: serial: cp210x: drop unnecessary packed attributes
  USB: serial: cp210x: add support for TIOCGICOUNT
  USB: serial: cp210x: add support for line-status events
  USB: serial: cp210x: disable interface on errors in open
  USB: serial: drop redundant transfer-buffer casts
  USB: serial: drop extern keyword from function declarations
  USB: serial: drop unnecessary sysrq include
  USB: serial: add sysrq break-handler dummy
  USB: serial: inline sysrq dummy function
  USB: serial: only process sysrq when enabled
  USB: serial: only set sysrq timestamp for consoles
  USB: serial: ftdi_sio: fix break and sysrq handling
  USB: serial: ftdi_sio: clean up receive processing
  USB: serial: ftdi_sio: make process-packet buffer unsigned
  USB: serial: use fallthrough pseudo-keyword
  USB: serial: ch341: fix missing simulated-break margin
  ...
</content>
</entry>
<entry>
<title>USB: serial: ch341: fix missing simulated-break margin</title>
<updated>2020-07-07T15:32:02Z</updated>
<author>
<name>Michael Hanselmann</name>
</author>
<published>2020-07-07T14:53:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d0bdc42842a8507c8218244b4ced09ca698d965'/>
<id>urn:sha1:6d0bdc42842a8507c8218244b4ced09ca698d965</id>
<content type='text'>
On devices which do not support break signalling a break condition is
simulated by sending a NUL byte at the lowest possible speed. The break
condition will be 9 bit periods long (start bit and eight data bits),
but the transmission itself also includes the stop bit.

Add the missing safety margin of one bit which is intended to account
for timing differences, and fix up the corresponding comment.

Signed-off-by: Michael Hanselmann &lt;public@hansmi.ch&gt;
Link: https://lore.kernel.org/r/9909b288-294d-16b9-9f14-51eb79c63b6c@msgid.hansmi.ch
[ johan: amend commit message ]
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: simulate break condition if not supported</title>
<updated>2020-07-06T09:25:07Z</updated>
<author>
<name>Michael Hanselmann</name>
</author>
<published>2020-07-04T18:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0580baa46ef67069217bfeabd511ea036e58c1c0'/>
<id>urn:sha1:0580baa46ef67069217bfeabd511ea036e58c1c0</id>
<content type='text'>
A subset of all CH341 devices don't support a real break condition. This
fact is already used in the "ch341_detect_quirks" function. With this
change a quirk is implemented to simulate a break condition by
temporarily lowering the baud rate and sending a NUL byte.

The primary drawbacks of this approach are that the duration of the
break can't be controlled by userland and that data incoming during
a simulated break is corrupted.

The "TTY_DRIVER_HARDWARE_BREAK" serial driver flag was investigated as
an alternative. It's a driver-wide flag and would've required
significant changes to the serial and USB-serial driver frameworks to
expose it for individual USB-serial adapters.

Tested by sending a break condition and watching the TX pin using an
oscilloscope.

Signed-off-by: Michael Hanselmann &lt;public@hansmi.ch&gt;
Link: https://lore.kernel.org/r/f34a9b6e-ec2a-0873-e97b-2d5b2170e2ff@msgid.hansmi.ch
[ johan: condense info message ]
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: ch341: add min and max line-speed macros</title>
<updated>2020-06-30T10:07:00Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2020-06-30T09:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=86f6da2951db571255ea0b1af7c6115ab870b757'/>
<id>urn:sha1:86f6da2951db571255ea0b1af7c6115ab870b757</id>
<content type='text'>
The line-speed algorithm clamps the requested value to the supported
range instead of bailing out on unsupported values.

Provide min and max macros and indicate how they are derived instead of
hardcoding the limits.

Note that the algorithm depends on the minimum rate (45.78 bps)
being rounded up (and the maximum rate being rounded down) to avoid
special casing.

Suggested-by: Michael Hanselmann &lt;public@hansmi.ch&gt;
Link: https://lore.kernel.org/r/20200630095756.GZ3334@localhost
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
</entry>
</feed>
