[coreboot] New patch to review for coreboot: 1262d0e libpayload: Check for completion more often in ehci_set_periodic_schedule.

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Tue Feb 26 01:31:25 CET 2013


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2522

-gerrit

commit 1262d0e0493d24a6230ddfef14e3883963b2eae4
Author: Gabe Black <gabeblack at google.com>
Date:   Wed Nov 21 02:16:13 2012 -0800

    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 <gabeblack at google.com>
---
 payloads/libpayload/drivers/usb/ehci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 3e57902..ec33b18 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;



More information about the coreboot mailing list