Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/23686
Change subject: libpayload/drivers/usb/uhci: Fix regression ......................................................................
libpayload/drivers/usb/uhci: Fix regression
Commit e9738dbe "Make USB transfer functions return amount of bytes" introduced a regression on all UHCI controllers.
Instead of returning the amount of bytes processed, it returned zero on success.
Fixes infinite usb_poll loop on Lenovo T500 using UHCI controller.
Change-Id: I823521e24f6f9e04c86d36fda751c449cd884ce3 Signed-off-by: Patrick Rudolph siro@das-labor.org --- M payloads/libpayload/drivers/usb/uhci.c 1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/23686/1
diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c index cdba3de..c2a0beb 100644 --- a/payloads/libpayload/drivers/usb/uhci.c +++ b/payloads/libpayload/drivers/usb/uhci.c @@ -315,6 +315,7 @@ int count = (2 + (dalen + mlen - 1) / mlen); unsigned short req = ((unsigned short *) devreq)[0]; int i; + int result = dalen; td_t *tds = memalign (16, sizeof (td_t) * count); memset (tds, 0, sizeof (td_t) * count); count--; /* to compensate for 0-indexed array */ @@ -367,10 +368,7 @@ td_t *td = wait_for_completed_qh (dev->controller, UHCI_INST (dev->controller)-> qh_data); - int result; - if (td == 0) { - result = 0; - } else { + if (td) { usb_debug ("control packet, req %x\n", req); td_dump (td); result = -1;