usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround"
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 2 Oct 2018 11:57:44 +0000 (20:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:41 +0000 (11:08 -0800)
commit11abbcd397a4688f020397e9dd978303370004dc
tree9814ae89fc35650899340aa65c57390758e06ef2
parent512307dd4f0976fa83d7cf576d10c426869bb3f5
usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround"

commit afc92514a34c7414b28047b1205a6b709103c699 upstream.

If the "workaround_for_vbus" is true, the driver will not call
usb_disconnect(). So, since the controller keeps some registers'
value, the driver doesn't re-enumarate suitable speed after
the b-device mode is disabled. To fix the issue, this patch
adds usb_disconnect() calling in renesas_usb3_b_device_write()
if workaround_for_vbus is true.

Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the b-device mode")
Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/renesas_usb3.c