]> 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)
commitf7b0c8f9bc4f170bd79c023a462e97b3e84f3af2
tree2bc9d7f51dadd89a053a99223bc5fa74c5b7c200
parentc57b861674e25e5ebf174617803779dfa09c98ab
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