diff options
author | Nico Huber <nico.huber@secunet.com> | 2012-11-22 11:12:13 +0100 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2012-11-24 08:44:01 +0100 |
commit | be58fee28e9f0c4d8f196added0105a101512acc (patch) | |
tree | 68fa33a0eb6833dac63295400e3b20d16760ce40 /payloads/libpayload/drivers/usb/uhci.c | |
parent | 8c4d2f36a339ba34c532e29696f2c5b70fb04957 (diff) | |
download | coreboot-be58fee28e9f0c4d8f196added0105a101512acc.tar.xz |
libpayload: Handle errors in UHCI interrupt queues
If somethings goes wrong during an interrupt transfer, drop the
transfer.
Change-Id: I450c08a7a0bf23fbee74237e0355d4a726ace114
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1901
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload/drivers/usb/uhci.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/uhci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c index 386392b53f..bf611d2613 100644 --- a/payloads/libpayload/drivers/usb/uhci.c +++ b/payloads/libpayload/drivers/usb/uhci.c @@ -572,7 +572,6 @@ uhci_poll_intr_queue (void *q_) { intr_q *q = (intr_q*)q_; if ((q->tds[q->lastread].ctrlsts & TD_STATUS_ACTIVE) == 0) { - /* FIXME: handle errors */ int current = q->lastread; int previous; if (q->lastread == 0) { @@ -588,7 +587,8 @@ uhci_poll_intr_queue (void *q_) } q->tds[previous].ctrlsts |= TD_STATUS_ACTIVE; q->lastread = (q->lastread + 1) % q->total; - return &q->data[current*q->reqsize]; + if (!(q->tds[current].ctrlsts & TD_STATUS_MASK)) + return &q->data[current*q->reqsize]; } /* reset queue if we fully processed it after underrun */ else if (q->qh->elementlinkptr & FLISTP_TERMINATE) { |