phy: rockchip-inno-usb2: increase otg sm work first schedule time
authorWilliam Wu <william.wu@rock-chips.com>
Fri, 5 May 2017 10:16:32 +0000 (18:16 +0800)
committerWilliam Wu <william.wu@rock-chips.com>
Mon, 8 May 2017 09:34:25 +0000 (17:34 +0800)
commit81f3ef435d919b64b38c3a2fa701833566ad9e62
treed7e5e1c8aa44ade4692cf7f86f4ca42b637cf3a2
parentf111309c6a051f3fa6b48f9f5e372faba118b601
phy: rockchip-inno-usb2: increase otg sm work first schedule time

In rockchip inno usb2 phy driver, we use otg_sm_work to
dynamically manage power consumption for phy otg-port.
If the otg-port works as peripheral mode and doesn't
communicate with usb host, we will suspend phy.

But once suspend phy, the phy no longer has any internal
clock running, include the utmi_clk which supplied for
usb controller. So if we suspend phy before usb controller
init, it will cause usb controller fail to initialize.

Specifically, without this pathch, the observed order is:
 1. unplug usb cable
 2. start system, do dwc2 controller probe
 3. dwc2_lowlevel_hw_enable()
    - phy_init()
     - rockchip_usb2phy_init()
      - schedule otg_sm_work after 2s
        put phy in suspend, and close utmi_clk
 4. dwc2_hsotg_udc_start() - fail to initialize the usb core

Generally, dwc2_hsotg_udc_start() can be called within 5s
after start system on rockchip platform, so we increase the
the first schedule delay time to 6s for otg_sm_work afer usb
controller calls phy_init(), this can make sure that the usb
controller completes initialization before phy enter suspend.

Change-Id: I40a7f6b24620e49a1273cb9c5051d62efb62810d
Signed-off-by: William Wu <william.wu@rock-chips.com>
drivers/phy/phy-rockchip-inno-usb2.c