usb: dwc_otg_310: fix reboot test fail in otg host mode
authorWilliam Wu <william.wu@rock-chips.com>
Fri, 26 May 2017 03:54:15 +0000 (11:54 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 26 May 2017 08:17:11 +0000 (16:17 +0800)
commit0d74da8302d492dbb5922ff128c0b351d0b69d72
treef9b4d9db6dae94caf584ce8ecb66b47cb60e8667
parentaa96c283d37621ec3b88ea8b42f21011768525d6
usb: dwc_otg_310: fix reboot test fail in otg host mode

When do reboot test with otg cable plugging in, it may
casue two issues: 1. system hung when access grstctl reg
in dwc_otg_core_reset(); 2. kernel panic when remove the
host channel from the free list in assign_and_init_hc().

This patch adds 1.5~2ms delay afer resume USB2 PHY, the
time for utmi_clk provided from USB2 PHY to stabilize,
and then we can access the usb core registers safely, it
can avoid system hung.

Also, we avoid to call otg20_hcd_connect_detect() if dwc2
is host mode except force host mode during probe, because
we will do the same work in check_id_work() later. This can
fix the issue that init usb core and host twice when boot
with otg cable and usb device, which may cause kernel panic
because of hc list is NULL.

Change-Id: I35aa36762c64b14b580b493d213610379676ab56
Signed-off-by: William Wu <william.wu@rock-chips.com>
drivers/usb/dwc_otg_310/dwc_otg_hcd_linux.c