From: William Wu Date: Wed, 15 Mar 2017 09:28:18 +0000 (+0800) Subject: phy: rockchip-inno-usb2: don't power on otg phy in ls irq handler X-Git-Tag: firefly_0821_release~328 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7cc91d50e9cf6726870f40cb73924128a1149311;p=firefly-linux-kernel-4.4.55.git phy: rockchip-inno-usb2: don't power on otg phy in ls irq handler 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 --- diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index a4468d9420c2..8a6120c0e086 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -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; }