summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-10-22 14:08:13 +0200
committerWolfgang Denk <wd@denx.de>2010-10-22 14:21:56 +0200
commit9038e0e7029e47ec1700128351281225f711545e (patch)
tree7ffacdb4ebbefc814d34c7ccb8d8895086bd6155
parentfff6ec382c139eb242bd85356e66a0bc43becb63 (diff)
downloadtalos-obmc-uboot-9038e0e7029e47ec1700128351281225f711545e.tar.gz
talos-obmc-uboot-9038e0e7029e47ec1700128351281225f711545e.zip
ehci-hcd.c: fix hanging under higher load
This patch solves a problem with USB hanging under higher load on a i.MX31 board. It falls into class of typical USB problems and fixes: if you don't understand the real cause, add a delay somewhere. The problem appeared after introduction of ELF relocation, which results in smaller code, which appears to run faster (probably because it fits better in the cache); turning off the instruction cache, adding debug printf()s and increasing the delay have all been found to make the problem go away. Moving the original "udelay(1)" up in the code to it's new place made the problem appear much less frequently. Increasing the delay to 2 microseconds then made the code run reliably in all (hour-long) tests. To be on the safe side, we set it to 5 microseconds here. Signed-off-by: Heiko schocher <hs@denx.de> Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Remy Bohmer <linux@bohmer.net> Cc: Stefano Babic <sbabic@denx.de>
-rw-r--r--drivers/usb/host/ehci-hcd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index f44fc4e3c4..982f96e8b8 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -205,12 +205,12 @@ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
uint32_t result;
do {
result = ehci_readl(ptr);
+ udelay(5);
if (result == ~(uint32_t)0)
return -1;
result &= mask;
if (result == done)
return 0;
- udelay(1);
usec--;
} while (usec > 0);
return -1;
OpenPOWER on IntegriCloud