From: Michal Pecio <michal.pecio@gmail.com>
To: Nicolai Buchwitz <nb@tipi-net.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Steve Bayless <steve_bayless@keysight.com>,
Guido Kiener <guido@kiener-muenchen.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Mathias Nyman <mathias.nyman@intel.com>
Subject: Re: [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI
Date: Fri, 23 Oct 2026 20:26:45 +0200 [thread overview]
Message-ID: <20261023202645.7bf4827a.michal.pecio@gmail.com> (raw)
In-Reply-To: <cae2e837872be0560f7f46e13651059b@tipi-net.de>
On Wed, 21 Oct 2026 11:34:19 +0200, Nicolai Buchwitz wrote:
> I checked on Windows 11 (Intel xHCI, WinUSB + libusb): same
> descriptors as on Linux (HS, bulk wMaxPacketSize 64), and a single
> 4096 byte bulk IN read returns the complete 110 byte reply, so it
> seems, that Windows programs the 64 bytes into the endpoint instead
> of forcing 512.
Yes, that's what it seems to be doing. I passed a fake storage device
with weird endpoints to Windows 10 in QEMU and with some debug tracing
(slot/ep context hexdumps are my addition) I see this:
usb_xhci_fetch_trb addr 0x0000000139a3c450, CR_CONFIGURE_ENDPOINT, p 0x000000013a18d000, s 0x00000000, c 0x01003001
usb_xhci_slot_ctx addr 0x000000013a18d020, c 0x68000000 0x00000000 0x00000000 0x00000000
usb_xhci_ep_ctx addr 0x000000013a18d0a0, ep 4, c 0x00000000 0x00400016 0x39a3cc01 0x00000001 0x00000000
usb_xhci_ep_ctx addr 0x000000013a18d1c0, ep 13, c 0x00000000 0x00400036 0x375ff001 0x00000001 0x00000000
The 0x0040 in the second field is packet size, and it becomes 0x0400
when I change to 1024, or 0x0002 with 2050. Windows blindly copies
those eleven bits here and only gets upset if they are all zero, then
it resets and enumerates again a few times.
I don't have any out of spec device, so I tunned a Cypress FX2 into
one - it exactly replays every received packet back to the host. I
found that power of two sizes from 1 to 512 work, except on Etron HCs
which only take 512. Guess we could have an exception for those.
So this seems very viable. I will turn it into a proper patch and see
what the maintainers think. Seems better than patching class drivers.
Regards,
Michal
next prev parent reply other threads:[~2026-10-23 18:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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
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
2026-10-20 21:12 ` guido
2026-10-21 7:46 ` Nicolai Buchwitz
2026-10-21 12:29 ` Guido Kiener
2026-10-20 22:56 ` Michal Pecio
2026-10-21 7:42 ` Nicolai Buchwitz
2026-10-21 9:34 ` Nicolai Buchwitz
2026-10-23 18:26 ` Michal Pecio [this message]
2026-10-24 11:17 ` Nicolai Buchwitz
2026-10-24 20:23 ` Michal Pecio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261023202645.7bf4827a.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=guido@kiener-muenchen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=nb@tipi-net.de \
--cc=stable@vger.kernel.org \
--cc=steve_bayless@keysight.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®