On Wed, 16 Nov 2011, Michal Nazarewicz wrote: > On Wed, 16 Nov 2011 22:33:07 +0100, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > I just came across a bug in the net2280 driver. A quick check shows > > it's present in many of the other UDC drivers as well. The bug is > > related to the switch from usb_gadget_driver:speed to max_speed, and > > it's also related to the increasing support for USB_SPEED_SUPER. > > > > In Felipe's tree, net2280_start() has code like this: > > > > if (!driver || driver->max_speed != USB_SPEED_HIGH > > || !driver->setup) > > return -EINVAL; > > > > The test should be: driver->max_speed < USB_SPEED_HIGH. As it is, the > > UDC driver won't accept gadget drivers that support SuperSpeed. > > I must admit that I was aware that something like that may happen but > though it was a rather theoretical problem at that point and hadn't > prioritized looking at it high enough yet. Sorry about that. > > > A similar problem is present in Greg's tree, but fixing it there will > > be more difficult. The easiest approach might be to get commit > > d93bb846f5 (usb: gadget: rename usb_gadget_driver::speed to max_speed) > > into Greg's tree and then add a fix on top of it. What do you think? > > I guess fixing the issue is the same amount of work regardless of applying > mentioned commit, right? As you described it boils down to changing the > != check to <, right? Right. That's probably true for the other UDC drivers as well, but I didn't check specifically. > The only thing will be that applying d93bb846f5 on top of the fix will get > tricky, but if that's the problem, I can take care of that, and resend > fixed patch. Yeah, that's why I thought it would be more work. But if you prefer to do it this way, I don't mind. Alan Stern -- 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