From 02a2f92e90baa1bf5aca8ddb7717399656b52118 Mon Sep 17 00:00:00 2001 From: William Wu Date: Mon, 1 Feb 2021 20:30:59 +0800 Subject: [PATCH] phy: rockchip: inno-usb2: delay power off phy when unplug otg host If the OTG work in Host mode, delay power off phy in OTG_STATE_B_IDLE state when unplug OTG cable, this can fix the xHCI deregistered error with the following log on RK356x platforms: [ 16.856295] xhci-hcd xhci-hcd.5.auto: remove, state 4 [ 16.856340] usb usb8: USB disconnect, device number 1 [ 16.857778] xhci-hcd xhci-hcd.5.auto: USB bus 8 deregistered [ 16.858108] xhci-hcd xhci-hcd.5.auto: remove, state 4 [ 16.858146] usb usb7: USB disconnect, device number 1 [ 16.878109] xhci-hcd xhci-hcd.5.auto: Host halt failed, -110 [ 16.878151] xhci-hcd xhci-hcd.5.auto: Host controller not halted, aborting reset. [ 16.878853] xhci-hcd xhci-hcd.5.auto: USB bus 7 deregistered Change-Id: I4467afdd3fe20839a9ec967624868ce3773e048c Signed-off-by: William Wu --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index c91ab5d35aa2..4deac4c71695 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1114,9 +1114,6 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) == 0) { dev_dbg(&rport->phy->dev, "usb otg host disconnect\n"); rport->state = OTG_STATE_B_IDLE; - mutex_unlock(&rport->mutex); - rockchip_usb2phy_power_off(rport->phy); - mutex_lock(&rport->mutex); sch_work = true; } else { mutex_unlock(&rport->mutex);