Re: [PATCH] usb: xhci: Relax high-speed bulk max packet size rules

From: Michal Pecio

Date: Sun Dec 06 2026 - 03:30:25 EST


On Wed, 28 Oct 2026 10:43:29 +0100, Michal Pecio wrote:
> Nicolai reported multiple dodgy high-speed devices still being made
> which declare out-of-spec bulk wMaxPacketSize and actually require
> the host to use it for correct operation. Apparently, Windows copies
> this field to the EP Context verbatim and other Linux HCDs like EHCI
> and DWC2 do similar things for compatibility's sake.
>
> We are also aware of devices like astronomical cameras which use 1KB
> to reduce protocol overhead, and audio devices with MIDI endpoints
> that specify unusual MPS like 8 or 4 (the latter was full-speed) and
> work with larger sizes just fine because they never do multi-packet
> transfers where MPS really matters.
>
> I found that sensible (power of two, 8 - 512) MPS are usable on many
> xHCI controllers from vendors like AMD, ASMedia, Fresco, NEC/Renesas,
> and VIA. Nicolai also tested two Raspberry Pi SBCs and a modern Intel
> machine running Windows 11 and 64B endpoints worked.
>
> OTOH, Etron rejects Configure Endpoint if MPS != 512. For such cases,
> commit e4f47e3675e6 ("USB: xHCI: override bogus bulk wMaxPacketSize
> values") sets HS bulk MPS to 512, which obviously breaks those dodgy
> devices that perform multi-packet transfers with other size.
>
> Problematic devices known so far use power of two MPS of at least 64,
> so try to recognize them with this heuristic. Non power of two or
> small MPS seems to indicate a clueless device which treats bulk like
> interrupt and specifies intended transfer size; we will use standard
> MPS here to avoid trouble with potential other HCs like Etron.
>
> Reported-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-usb/20261020-fix-usbtmc-short-packets-v1-0-903f4d029193@xxxxxxxxxxx/
> Link: https://lore.kernel.org/linux-usb/93d5aeb4-f1c7-9342-7bc5-4b277b4ec55e@xxxxxxxxx/
> Link: https://lore.kernel.org/alsa-devel/CAE-xCyPhrS6pgY0T9SG0TCubSi0CE2Yd5H=ttOzBmvgrR8fTPA@xxxxxxxxxxxxxx/
> Link: https://lore.kernel.org/linux-usb/348c50de-f922-8295-ef87-cf5cdea5c7f4@xxxxxxxxx/
> Signed-off-by: Michal Pecio <michal.pecio@xxxxxxxxx>

Hi,

Gentle ping about this one. I'm not a big fan of out-of-spec, but this
seems to be widely accepted as necessary evil (we can also add NVIDIA
Tegra K1 and Texas Instruments TUSB7340 to the tested list).

Windows seems to take this for granted so much that it can't configure
my DIY 64B maxpacket device on Etron - it looks like they don't make an
exception for Etron, we will.

The only in-spec alternative seems to be queuing a sequence of 64B TDs.
This should work fine on OUT, but there seems to be no way to stop on
short transfers for IN, besides queuing the TDs one by one from IRQ.

Regards,
Michal