mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI
@ 2026-10-20 14:33 Nicolai Buchwitz
  2026-10-20 14:33 ` [PATCH 1/4] usb: usbtmc: handle undersized high-speed bulk IN packets Nicolai Buchwitz
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Nicolai Buchwitz @ 2026-10-20 14:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Steve Bayless, Guido Kiener
  Cc: linux-usb, linux-kernel, Nicolai Buchwitz, stable

The Siglent SDM4065A-SC, Rigol DP800 and Rigol DS1000Z (and probably
others) advertise 64-byte bulk endpoints at high speed. USB 2.0 only
allows 512, which xHCI correctly implements. Unfortunately this breaks
usbtmc on these devices. Reads stop after the first packet, and longer
writes also fail or hang the OUT endpoint until a USB reset:

  usb 1-1.3: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
  usbtmc 1-1.3:1.0: Device sent too small first packet: 8 < 12
  usbtmc 1-1.3:1.0: Unable to send data, error -110

We ran into this in our factory once we switched some test PCs from
dwc2 based hardware to xHCI based ones. dwc2 uses the advertised 64
bytes, so the devices worked fine before.

This series adds a quirk table to usbtmc and moves one packet per URB
for the devices in it. The DP800 also wants a ZLP after a write that
ends on a packet boundary. Only read() and write() change, the ioctls
behave as before. More devices can go into the table as they turn up.

The Rigols still have one issue I can't work around. They split replies
over 500 bytes into several transfers, and a follow-on transfer that
ends exactly on a packet boundary never arrives. Raw libusb shows the
same, so I guess it's another firmware bug. Should be fine for most use
cases though.

Tested on a Raspberry Pi CM4S (BCM2711 xHCI) and a CM5 (RP1 xHCI).

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
Nicolai Buchwitz (4):
      usb: usbtmc: handle undersized high-speed bulk IN packets
      usb: usbtmc: handle undersized high-speed bulk OUT packets
      usb: usbtmc: add Rigol DP800 and DS1000Z to the packet I/O quirk table
      usb: usbtmc: send a ZLP after a full last packet in packet I/O mode

 drivers/usb/class/usbtmc.c | 87 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 76 insertions(+), 11 deletions(-)
---
base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a
change-id: 20261020-fix-usbtmc-short-packets-1c4e233ae407

Best regards,
--  
Nicolai Buchwitz <nb@tipi-net.de>


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

end of thread, other threads:[~2026-10-20 18:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 14:33 [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 1/4] usb: usbtmc: handle undersized high-speed bulk IN packets Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 2/4] usb: usbtmc: handle undersized high-speed bulk OUT packets Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 3/4] usb: usbtmc: add Rigol DP800 and DS1000Z to the packet I/O quirk table Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 4/4] usb: usbtmc: send a ZLP after a full last packet in packet I/O mode Nicolai Buchwitz
2026-10-20 16:42 ` [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI Michal Pecio
2026-10-20 18:33   ` Nicolai Buchwitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®