usb: dwc3: core: reset the whole controller during probe

This patch reset the dwc3 controller at the beginning of
probe. Without this patch, it may fail in enumeration phase
if the dwc3 has been initialized and used before kernel.

Typically, we use usb to download image and boot directly
on RV1126 board, it will fail to connect to host with the
following error log:

[2.029506] read descriptors
[2.029597] read strings
[3.038749] dwc3 ffd00000.dwc3: unexpected direction for Data Phase
[3.077445] android_work: did not send uevent (0 0   (null))
[3.282586] vendor storage:20190527 ret = -1
[3.335505] usb0: HOST MAC 16:ba:52:5a:90:28
[3.335566] usb0: MAC 6a:73:d9:da:da:ce
[3.335597] configfs-gadget gadget: uvc_function_bind
[5.052086] dwc3 ffd00000.dwc3: unexpected direction for Data Phase
[5.052431] dwc3 ffd00000.dwc3: unexpected direction for Data Phase

Change-Id: I7eede4685a26cff5fc9460233291757edf18e430
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2020-07-13 20:50:43 +08:00
committed by Tao Huang
parent 82f893648d
commit 432a0d89dd

View File

@@ -1567,6 +1567,17 @@ static int dwc3_probe(struct platform_device *pdev)
if (IS_ERR(dwc->reset))
return PTR_ERR(dwc->reset);
ret = reset_control_deassert(dwc->reset);
if (ret)
return ret;
/* Reset the whole dwc3 controller */
ret = reset_control_assert(dwc->reset);
if (ret)
return ret;
udelay(1);
ret = reset_control_deassert(dwc->reset);
if (ret)
return ret;