]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: core: Fix ->udc_set_speed() speed handling
authorRoger Quadros <rogerq@ti.com>
Tue, 31 Oct 2017 13:56:29 +0000 (15:56 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 28 Nov 2017 11:05:31 +0000 (13:05 +0200)
commit2c8736331f7b7d76de4fa2f82f8c31ba6587e03e
tree2bc9d7f51dadd89a053a99223bc5fa74c5b7c200
parente789ad6d2ace243bdd34f0d6bcec01f35e624ccb
usb: gadget: core: Fix ->udc_set_speed() speed handling

Currently UDC core calls ->udc_set_speed() with the speed parameter
containing the maximum speed supported by the gadget function
driver. This might very well be more than that supported by the
UDC controller driver.

Select the lesser of the 2 speeds so both UDC and gadget function
driver are operating within limits.

This fixes PHY Erratic errors and 2 second enumeration delay on
TI's AM437x platforms.

Fixes: 6099eca796ae ("usb: gadget: core: introduce ->udc_set_speed() method")
Cc: <stable@vger.kernel.org> # v4.13+
Reported-by: Dylan Howey <Dylan.Howey@tennantco.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/core.c