Re: [PATCH v2] usbcore: Add quirk for 255-bytes initial config read

From: Alan Stern

Date: Sun Jun 28 2026 - 09:55:24 EST


On Sun, Jun 28, 2026 at 11:53:09AM +0530, Nikhil Solanke wrote:
> I need some help with the USB_QUIRK_DELAY_INIT part. I can't figure
> out how to make it properly work with my patch because of the
> following reasons:
>
> 1. I don't want to move it to the top because, from my pov, there must
> have been some reason for placing that quirk where it is now. so i
> don't want to mess with it.
>
> 2. Regarding my idea of adding a condition — so that it doesn't change
> the behavior when the quirk isn't set — if the full configuration set
> exceeds 255 bytes, we would have to issue a 2nd request. In this case
> the existing behavior would be more justified.
>
> So, I'm a bit confused about how to implement this properly. Adding
> yet another condition to fix the second case doesn't feel right to me.
> It would look unnecessarily complicated. I would appreciate a bit of
> help and advice.

If the 255-byte quirk flag isn't set, do the delay before the second
transfer just as it is now.

If the 255-byte quirk flag is set, do the delay before the first
transfer. If a second transfer is needed, you can do a second delay
before it or not -- I suspect it doesn't matter. If you want to be
safe, add the second delay.

Alan Stern