Re: UDC driver bug related to max_speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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.

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux