Re: [PATCH] usb: core: hub: Re-guess ep0 maxpacket size on reset

From: Alan Stern

Date: Thu Nov 05 2026 - 00:11:38 EST


On Wed, Nov 04, 2026 at 06:36:03PM +0100, Michal Pecio wrote:
> On Wed, 4 Nov 2026 09:59:24 -0500, Alan Stern wrote:
> > On Wed, Nov 04, 2026 at 08:44:02PM +0800, Pengfei Lv wrote:
> > > When the subsequent re-enumeration then uses the "new scheme" and
> > > issues a 64-byte GET_DESCRIPTOR (get_bMaxPacketSize0 with size=64),
> > > xhci_check_maxpacket() sees hw==sw==8 and does not issue an Evaluate
> > > Context command. The xHC queues a Data TRB of length 64 but applies
> > > ep0 max_packet=8 for short-packet detection.
> >
> > That's exactly what we want it to do.
>
> Should we want it, though?
>
> Were there known devices with bMaxPacketSize0 <= 16 which required the
> whole transfer to complete before they are reset?
>
> That's not what happens in the initial iteration, so it seems any such
> devices would always take two iterations to begin working.
>
> Is this what the only correct Proprietary Operating System does?

I don't know offhand of any positive or negative examples. But if a
device was going to hang if it was asked for the remaining part of
the device descriptor after a non-initial reset, how would it ever get
through initialization? The procedure does two resets, and after the
second reset the device has to send the full descriptor.

I don't know what other OSes do about this.

Alan Stern