Linux USB
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nicolai Buchwitz <nb@tipi-net.de>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: Relax high-speed bulk max packet size rules
Date: Sun, 6 Dec 2026 09:30:16 +0100	[thread overview]
Message-ID: <20261206093016.1f242dbc.michal.pecio@gmail.com> (raw)
In-Reply-To: <20261028104329.3d1c8029.michal.pecio@gmail.com>

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@tipi-net.de>
> Closes: https://lore.kernel.org/linux-usb/20261020-fix-usbtmc-short-packets-v1-0-903f4d029193@tipi-net.de/
> Link: https://lore.kernel.org/linux-usb/93d5aeb4-f1c7-9342-7bc5-4b277b4ec55e@veikia.lt/
> Link: https://lore.kernel.org/alsa-devel/CAE-xCyPhrS6pgY0T9SG0TCubSi0CE2Yd5H=ttOzBmvgrR8fTPA@mail.gmail.com/
> Link: https://lore.kernel.org/linux-usb/348c50de-f922-8295-ef87-cf5cdea5c7f4@gmail.com/
> Signed-off-by: Michal Pecio <michal.pecio@gmail.com>

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

      parent reply	other threads:[~2026-12-06  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  9:43 [PATCH] usb: xhci: Relax high-speed bulk max packet size rules Michal Pecio
2026-10-28  9:56 ` sashiko-bot
2026-10-28 19:23 ` Nicolai Buchwitz
2026-12-06  8:30 ` Michal Pecio [this message]

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=20261206093016.1f242dbc.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=nb@tipi-net.de \
    /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