summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2015-04-28 12:51:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-05-04 09:23:08 +0200
commit10bb13e7fdf4d1417a5f537b8ef00ded9502c0b9 (patch)
tree2e52ff926fa487c2d509a9acadafbfbc6bcec3c0 /drivers/usb/core
parent6da925f87c66cd9132018b4b08a84fa98c382aa7 (diff)
downloadbarebox-10bb13e7fdf4d1417a5f537b8ef00ded9502c0b9.tar.gz
barebox-10bb13e7fdf4d1417a5f537b8ef00ded9502c0b9.tar.xz
usb: increase USB_CNTL_TIMEOUT to match linux
USB requests should be processed within a timeframe of 5s. The linux kernel also uses this timeout value for the control packets. For the musb the increase in timeout helps successfully probing USB devices (at least on one test hardware), but on the other hand doesn't slow down the system, if there are no devices, i.e. the timeout never hits. That means, that the USB core correctly aborts instead of timing out. Why and how the 100ms was chosen in the first place, can not be deduced from the git history, just that it seems to work fine for most boards. Change USB_CNTL_TIMEOUT to 5000ms and replace all occurences of `USB_CNTL_TIMEOUT * x` with just `USB_CNTL_TIMEOUT`, as the timeout is now large enough without it. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index d1c3e0394d..9073fff4be 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -663,7 +663,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0,
- endp, NULL, 0, USB_CNTL_TIMEOUT * 3);
+ endp, NULL, 0, USB_CNTL_TIMEOUT);
/* don't clear if failed */
if (result < 0)
@@ -748,7 +748,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE,
alternate, interface, NULL, 0,
- USB_CNTL_TIMEOUT * 5);
+ USB_CNTL_TIMEOUT);
if (ret < 0)
return ret;