Re: [PATCH] usb: xhci: Relax high-speed bulk max packet size rules
From: Nicolai Buchwitz
Date: Wed Oct 28 2026 - 16:49:46 EST
Hi Michal
On Wed, 2026-10-28 at 10:43 +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.
Thanks for picking this up!
>
> 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>
> ---
> [...]
I ran the patch on a Raspberry Pi CM4S with a Rigol DP832A.
Multi-packet replies up to ~1 KB and writes up to 760 bytes
work fine. dmesg doesn't show anything suspicious.
Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Tested-by: Nicolai Buchwitz <nb@xxxxxxxxxxx> # BCM2711 in XHCI mode
Regards,
Nicolai
--
Nicolai Buchwitz <nb@xxxxxxxxxxx>