mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user