]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: core: fix ->udc_set_speed() logic
authorRoger Quadros <rogerq@ti.com>
Tue, 19 Sep 2017 08:46:16 +0000 (11:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:07 +0000 (11:56 +0200)
commitef8bc352b98f16223f8cbc9956d46786d9990d7a
treeb53b8c624e411dc502f7153e752fe51ff4a707d4
parent5e79bc75755072df2358a5fcda8f12dcdf7bfbd4
usb: gadget: core: fix ->udc_set_speed() logic

commit 97e133d54c1ca8948b191e5721a145a76c4db33d upstream.

Consider the following case: udc controller supports SuperSpeed.  If we
first load a HighSpeed gadget followed by a SuperSpeed gadget, the
SuperSpeed gadget will be limited to HighSpeed as UDC core driver
doesn't call ->udc_set_speed() in the second case.

Call ->udc_set_speed() unconditionally to fix this issue.

This will also fix the case for dwc3 controller driver when SuperSpeed
gadget is loaded first and works in HighSpeed only as udc_set_speed()
was never being called.

Fixes: 6099eca796ae ("usb: gadget: core: introduce ->udc_set_speed() method")
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/core.c