phy: rockchip-inno-usb2: don't power on otg phy in ls irq handler
authorWilliam Wu <wulf@rock-chips.com>
Wed, 15 Mar 2017 09:28:18 +0000 (17:28 +0800)
committerWilliam Wu <wulf@rock-chips.com>
Wed, 15 Mar 2017 09:38:47 +0000 (17:38 +0800)
The commit c590056b6ab8 ("phy: rockchip-inno-usb2: usb remote
wakeup support") power on otg phy in linestate irq handler,
this will cause usb peripheral fail to connect to PC in the
following case:
1. enable otg linestate irq
2. set system enter deep sleep
3. wakeup system by power key
4. connect usb peripheral to PC, pull up D+ to ~3V, trigger
   linestate irq and power on otg phy.
5. usb peripheral do BC1.2 detect, but PC try to enumerate
   the usb peripheral at the same time and fail at last.

Actually the usb controller drivers (e.g. dwc3 driver)
and otg_sm_work can manage the otg phy power consumption, so
it doesn't need to power on otg phy in linestate irq handler.

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

index a4468d9420c2441a455c4f702d40219fca32515e..8a6120c0e0864cdfb1caf7eac835fa3087a43905 100644 (file)
@@ -1019,12 +1019,8 @@ static irqreturn_t rockchip_usb2phy_linestate_irq(int irq, void *data)
         * meanwhile, if the phy port is suspended, we need rearm the work to
         * resume it and mange its states; otherwise, we do nothing about that.
         */
-       if (rport->suspended) {
-               if (rport->port_id == USB2PHY_PORT_HOST)
-                       rockchip_usb2phy_sm_work(&rport->sm_work.work);
-               else
-                       rockchip_usb2phy_power_on(rport->phy);
-       }
+       if (rport->suspended && rport->port_id == USB2PHY_PORT_HOST)
+               rockchip_usb2phy_sm_work(&rport->sm_work.work);
 
        return IRQ_HANDLED;
 }