mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] usb: ehci: honour timeout value
Date: Wed,  6 Jul 2016 11:16:22 +0200	[thread overview]
Message-ID: <1467796582-23000-1-git-send-email-s.hauer@pengutronix.de> (raw)

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>
---
 drivers/usb/host/ehci-hcd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index b0bf922..35cf6aa 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
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2016-07-06  9:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467796582-23000-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox