]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: dwc2: host: fix dwc2 disconnect bug
authorYunzhi Li <lyz@rock-chips.com>
Fri, 6 Mar 2015 07:17:10 +0000 (15:17 +0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 10 Mar 2015 20:48:29 +0000 (15:48 -0500)
When dwc2 controller detects a disconnect interrupt,
dwc2_hcd_disconnect() should be called immediately to do clean-up
jobs and set port_connect_status_change flag to notify usb hub
driver disconnect status.

Tested-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Yunzhi Li <lyz@rock-chips.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/core_intr.c

index 02e3e2d4ea5658c0ddd6de8b1cb1729425a3c0ab..6cf047878dbae1812d19c27b13d5d5a1ce71536a 100644 (file)
@@ -377,6 +377,9 @@ static void dwc2_handle_disconnect_intr(struct dwc2_hsotg *hsotg)
                dwc2_is_host_mode(hsotg) ? "Host" : "Device",
                dwc2_op_state_str(hsotg));
 
+       if (hsotg->op_state == OTG_STATE_A_HOST)
+               dwc2_hcd_disconnect(hsotg);
+
        /* Change to L3 (OFF) state */
        hsotg->lx_state = DWC2_L3;