USB: fix usb mouse detect insensitively.
authorwlf <wulf@rock-chips.com>
Wed, 24 Sep 2014 11:38:03 +0000 (19:38 +0800)
committerwlf <wulf@rock-chips.com>
Wed, 24 Sep 2014 11:38:03 +0000 (19:38 +0800)
In hot-plug case, the hcd->frame_number variable is abnormal,
and it will cause dwc_otg_hcd_handle_sof_intr to wait a long
time for periodic schedule frame. So need to unset
hcd->frame_number variable when devices disconnect.

drivers/usb/dwc_otg_310/dwc_otg_hcd.c

index 20aaba08ff30702e25db25a8718492d91f8bb959..cc5198bb4e750f95c09e297ea7704d7358006698 100755 (executable)
@@ -281,6 +281,7 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p)
        dwc_otg_hcd->non_periodic_qh_ptr = &dwc_otg_hcd->non_periodic_sched_active;
        dwc_otg_hcd->non_periodic_channels = 0;
        dwc_otg_hcd->periodic_channels = 0;
+       dwc_otg_hcd->frame_number =0;
 
        hprt0.d32 = DWC_READ_REG32(dwc_otg_hcd->core_if->host_if->hprt0);
        /* In some case, we don't disconnect a usb device, but