On Thu, Jul 9, 2009 at 12:44 PM, Daniel Mack<daniel@xxxxxxxx> wrote: > On Thu, Jul 09, 2009 at 11:04:05AM -0400, Alan Stern wrote: >> Your "USB: allow malformed LANGID descriptors" patch (commit >> b7af0bb26899bb47ae16fb41d2296111b0784a56) is causing a regression: >> >> http://bugzilla.kernel.org/show_bug.cgi?id=13700 >> >> The usbmon log attached to comment #11 shows how the 5-2 device >> doesn't work with this patch. It rejects attempts to read string 0 >> (the language ID list) with a STALL, and it crashes when the kernel >> attempts to read a string using language 0. > > Ok, let me get this straight. > > The device STALLS EP0 when asked for string descriptor 0, so it tells > it's not willing to hand out any string at all. Haven't checked with the > USB specs whether this is correct behaviour, but this is what it looks > like. > > When an endpoint communication stalls, the return value is -EPIPE, and > in case of a malformed string descriptor we seem to be getting -ENODATA. > > Handling those two case seperately should make both sides happy. > > Could you test the patch below? It's only compile tested for now. > > Thanks, > Daniel > > Your patch is wrong and maybe so is the current code, I haven't looked. 1) String descriptors are optional, a device does not have to have any. b) When a device cannot handle a control command, it will return a STALL pid. iii) When windows xp enumerates a gadget and it gets a stall on the string desc "0" fetch, it stops fetching device strings. Since most gadgets are only tested under windows, if you then request a string after it has told you there are no strings, some gadgets will hang. I believe that the proper response after getting a STALL from a fetch of string desc 0, the system should flag the device as not having strings and fail all future requests with a STALL (EPIPE) - without going out on the bus. I am working with a quite old kernel and cannot provide a patch to the latest kernel to try this. Regards, Steve -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html