Re: [PATCH v2] usbcore: Add quirk for 255-bytes initial config read
From: Michal Pecio
Date: Sun Jun 28 2026 - 16:42:18 EST
On Sun, 28 Jun 2026 15:18:02 -0400, Alan Stern wrote:
> On Sun, Jun 28, 2026 at 07:02:01PM +0200, Michal Pecio wrote:
> > If such devices will exist, then it probably won't matter whether
> > the delay comes after or before the first request. Purpose isn't
> > known, but it appears to be rate limiting configuration descriptor
> > requests or delaying other requests after this function returns.
>
> In fact, the commit that talks about the Logitech webcams does
> describe their buggy behavior to some extent. It says that they seem
> to reply with stale video data instead of the real config
> information, and from there it's a short guess that adding a delay
> gives time for the video pipeline to drain or time out.
>
> In addition, the fact that the delay is needed after the first
> request but before the second suggests that the data corruption only
> affects transfers longer than 9 bytes -- which the new first request
> would be. Therefore it would be appropriate to have the delay before
> the new first request. Whether another delay would be needed before
> the second request (if there is one) is unknown.
Fair enough, that's possible, but even in these specific webcams it's
still unclear what delays would be necessary with both quirks. We wait
for the HW to complete something, but we don't know what starts it. If
it's device reset, then b2a542bbb308 has already doubled all delays
so d86db25e53fa6 isn't even necessary anymore. OTOH, if it's the first
config request, then a delay between the requests is mandatory, and
a delay before the first request is useless. If it's something in
between then your approach could be the only viable choice.
I would worry about it when a device is known that uses both quirks.
> Good point. But I dislike messages that actively produce wrong
> information. Nikhil could get rid of the parts of the log messages
> you don't like, but he shouldn't leave them as they are. He could
> even do that in a second patch, separate from this one.
I can agree that the first "descriptor too short" message becomes
misleading, because we no longer expect 9 bytes exactly, but anything
between 9 and 255. So this could be changed to "requested".
But I see no need to change the second message. Regardless of initial
request length, the next request (if any) asks for the exact size and
we do expect it to produce 'length' bytes.
Using different words in these messages has a beneficial side effect
of making it possible to tell them apart when wTotalLength == 9.
Regards,
Michal