Ah, ok!
It's not this outer loop that is looping, it's a loop internal to usb_get_descriptor:
http://lxr.free-electrons.com/source/drivers/usb/core/message.c#L630The problem is that Linux doesn't differentiate a stall from an actual error.
When it gets a stall it just repeats the request 3 times for "flakey devices".
So you'd have to return something and it would have to have 0x06 as the 2nd byte (bDescriptorType) or it's an error.
If you return any 10 bytes then check_highspeed would give a message of
"not running at top speed; connect to a high speed hub"
If you return less or more than 10 bytes it will accept this as a non-error but ignore it as a non-device qualifer.
Still, returning non-standard stuff to shut Linux up is stupid.
Of course, you could just set the bcdUSB to less than 0x0200, but there are some differences between USB 1.1 and 2.0.
(Um, number of allowed endpoints and ? ? ?)
So, the bottom line is: just live with it?