summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-05-18 20:46:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-06 11:15:39 +0200
commit04f3cde15146e49339e20dac6986de303d1e7e31 (patch)
tree5890f089afe240945282aac45a1789a11e917403 /drivers
parente5c6340f42a9430ca55e49a0d935c59eddb5fbe4 (diff)
downloadbarebox-04f3cde15146e49339e20dac6986de303d1e7e31.tar.gz
barebox-04f3cde15146e49339e20dac6986de303d1e7e31.tar.xz
usb: ehci: honour timeout value
usb_control_msg() and usb_bulk_msg() have a timeout parameter. Honour this in the ehci driver instead of using a default timeout. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-hcd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index b0bf9225ec..35cf6aa0ad 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -215,7 +215,7 @@ static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
static int
ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
- int length, struct devrequest *req)
+ int length, struct devrequest *req, int timeout_ms)
{
struct usb_host *host = dev->host;
struct ehci_priv *ehci = to_ehci(host);
@@ -364,7 +364,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
}
/* Wait for TDs to be processed. */
- timeout_val = usb_pipebulk(pipe) ? (SECOND << 2) : (SECOND >> 2);
+ timeout_val = timeout_ms * MSECOND;
start = get_time_ns();
vtd = td;
do {
@@ -893,7 +893,7 @@ submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
dev_dbg(ehci->dev, "non-bulk pipe (type=%lu)", usb_pipetype(pipe));
return -1;
}
- return ehci_submit_async(dev, pipe, buffer, length, NULL);
+ return ehci_submit_async(dev, pipe, buffer, length, NULL, timeout);
}
static int
@@ -913,7 +913,7 @@ submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
dev->speed = USB_SPEED_HIGH;
return ehci_submit_root(dev, pipe, buffer, length, setup);
}
- return ehci_submit_async(dev, pipe, buffer, length, setup);
+ return ehci_submit_async(dev, pipe, buffer, length, setup, timeout);
}
static int