]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xhci: correct the usage of USB_CTRL_SET_TIMEOUT
authorxiao jin <jin.xiao@intel.com>
Fri, 11 Oct 2013 00:57:03 +0000 (08:57 +0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 16 Oct 2013 19:24:23 +0000 (12:24 -0700)
The usage of USB_CTRL_SET_TIMEOUT in xhci is incorrect.
The definition of USB_CTRL_SET_TIMEOUT is 5000ms. The
input timeout to wait_for_completion_interruptible_timeout
is jiffies. That makes the timeout be longer than what
we want, such as 50s in some platform.

The patch is to use XHCI_CMD_DEFAULT_TIMEOUT instead of
USB_CTRL_SET_TIMEOUT as command completion event timeout.

Signed-off-by: xiao jin <jin.xiao@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci.c

index 5dd7b7de66330381c6ee8988cd2efb4371956fdd..0c802081e33ba083e874ce14b44ed5a096c2cc88 100644 (file)
@@ -296,7 +296,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
        /* Wait for last stop endpoint command to finish */
        timeleft = wait_for_completion_interruptible_timeout(
                        cmd->completion,
-                       USB_CTRL_SET_TIMEOUT);
+                       XHCI_CMD_DEFAULT_TIMEOUT);
        if (timeleft <= 0) {
                xhci_warn(xhci, "%s while waiting for stop endpoint command\n",
                                timeleft == 0 ? "Timeout" : "Signal");
index e7571c90c40f56d91db9db6a392997738b3c497f..d3f6abbda67ecd07cd0dcabed9c1686c782f6a2c 100644 (file)
@@ -3447,7 +3447,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev)
        /* Wait for the Reset Device command to finish */
        timeleft = wait_for_completion_interruptible_timeout(
                        reset_device_cmd->completion,
-                       USB_CTRL_SET_TIMEOUT);
+                       XHCI_CMD_DEFAULT_TIMEOUT);
        if (timeleft <= 0) {
                xhci_warn(xhci, "%s while waiting for reset device command\n",
                                timeleft == 0 ? "Timeout" : "Signal");