Skip to content

usb-serial: xHCI and timeout fixes

Jason Andryuk qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v14 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4usb-serial: Move USB_TOKEN_IN into a helper functionhw/usb/dev-serial.c+46 -340 replies
2/4usb-serial: chunk data to wMaxPacketSizehw/usb/dev-serial.c+29 -180 replies
3/4usb-serial: Increase receive buffer to 496hw/usb/dev-serial.c+1 -10 replies
4/4usb-serial: Fix timeout closing the devicehw/usb/dev-serial.c+1 -10 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchSamuel Thibault
1/4
2/4
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] usb-serial: xHCI and timeout fixes

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(-)
Signature · 1 line
2.24.1