From ef650a5d2456196d653667de7d02abc0591ec024 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 21 Nov 2012 02:16:13 -0800 Subject: libpayload: Check for completion more often in ehci_set_periodic_schedule. This function was using mdelay in a loop to check for the completion of an USB controller operation. Since we're busy waiting anyway, we might as well wait only 1 us before checking again and potentially seeing the completion 999 us earlier than we would otherwise. Change-Id: I177b303c5503a0078c608d5f945c395691d4bd8a Signed-off-by: Gabe Black Reviewed-on: http://review.coreboot.org/2522 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin Reviewed-by: Anton Kochkov --- payloads/libpayload/drivers/usb/ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'payloads') diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c index 3e57902c70..ec33b18216 100644 --- a/payloads/libpayload/drivers/usb/ehci.c +++ b/payloads/libpayload/drivers/usb/ehci.c @@ -157,10 +157,10 @@ static int ehci_set_periodic_schedule(ehci_t *ehcic, int enable) * This shouldn't take too long, but we should timeout nevertheless. */ enable = enable ? HC_OP_PERIODIC_SCHED_STAT : 0; - int timeout = 100; /* time out after 100ms */ + int timeout = 100000; /* time out after 100ms */ while (((ehcic->operation->usbsts & HC_OP_PERIODIC_SCHED_STAT) != enable) && timeout--) - mdelay(1); + udelay(1); if (timeout < 0) { usb_debug("ehci periodic schedule status change timed out.\n"); return 1; -- cgit v1.2.3