]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: dummy-hcd: fix connection failures (wrong speed)
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 26 Sep 2017 19:15:22 +0000 (15:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 07:18:01 +0000 (09:18 +0200)
commitf47d4026e5d73186e7b218c2a3e23aa09ab2fa06
treee202ed4389177dc1200389590ced5f14dc1625fc
parent4b01fcab0516e40d2fb53eeeb513bf8e2ba01982
USB: dummy-hcd: fix connection failures (wrong speed)

commit fe659bcc9b173bcfdd958ce2aec75e47651e74e1 upstream.

The dummy-hcd UDC driver is not careful about the way it handles
connection speeds.  It ignores the module parameter that is supposed
to govern the maximum connection speed and it doesn't set the HCD
flags properly for the case where it ends up running at full speed.

The result is that in many cases, gadget enumeration over dummy-hcd
fails because the bMaxPacketSize byte in the device descriptor is set
incorrectly.  For example, the default settings call for a high-speed
connection, but the maxpacket value for ep0 ends up being set for a
Super-Speed connection.

This patch fixes the problem by initializing the gadget's max_speed
and the HCD flags correctly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/dummy_hcd.c