qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] usb-serial: xHCI and timeout fixes
@ 2020-03-16 17:46 Jason Andryuk
  2020-03-16 17:46 ` [PATCH v2 1/4] usb-serial: Move USB_TOKEN_IN into a helper function Jason Andryuk
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jason Andryuk @ 2020-03-16 17:46 UTC (permalink / raw)
  To: Gerd Hoffmann, Samuel Thibault; +Cc: qemu-devel, Jason Andryuk

This patch series includes two fixes for usb-serial.

The first is a data corruption issue with xHCI controllers.  The FTDI
data packets need to have a 2 byte header start every 64 bytes of packet
data.  For EHCI this is not a problem since USBPacket size is 64, so
only 1 such chunk fits in a packet.  xHCI controllers supply 512 byte
USBPackets, and usb-serial would only write a single header.  This
confuses drivers since they interpret some data bytes as header bytes.
Chunk the data with headers at every 64 byte offset.

To allow full use of the 512 USBPackets, increase the buffer size to 512
- 2 * 8 = 496 bytes.

A second fix is to set the FTDI_THRE (Transmitter Holding Register) and
FTDI_TEMT (Transmitter Empty) status bits in a GetModemStat response.
This makes the linux driver happy when closing the device and avoids a
30 second timeout.

v2: Add braces to single line if statements to comply with coding style.
    Added Samuel's R-b to 3 & 4.  1 & 2 only changed by the addition of
    braces, but I don't know the protocol for this situation.

Jason Andryuk (4):
  usb-serial: Move USB_TOKEN_IN into a helper function
  usb-serial: chunk data to wMaxPacketSize
  usb-serial: Increase receive buffer to 496
  usb-serial: Fix timeout closing the device

 hw/usb/dev-serial.c | 95 ++++++++++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 36 deletions(-)

-- 
2.24.1



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

end of thread, other threads:[~2020-03-16 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-16 17:46 [PATCH v2 0/4] usb-serial: xHCI and timeout fixes Jason Andryuk
2020-03-16 17:46 ` [PATCH v2 1/4] usb-serial: Move USB_TOKEN_IN into a helper function Jason Andryuk
2020-03-16 17:46 ` [PATCH v2 2/4] usb-serial: chunk data to wMaxPacketSize Jason Andryuk
2020-03-16 17:46 ` [PATCH v2 3/4] usb-serial: Increase receive buffer to 496 Jason Andryuk
2020-03-16 17:46 ` [PATCH v2 4/4] usb-serial: Fix timeout closing the device Jason Andryuk

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).