[coreboot] New patch to review for coreboot: 6200319 libpayload: Handle errors in UHCI interrupt queues

Nico Huber (nico.huber@secunet.com) gerrit at coreboot.org
Fri Nov 23 15:01:01 CET 2012


Nico Huber (nico.huber at secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1901

-gerrit

commit 6200319695c67521bb2cf0725b58eba2b44e463f
Author: Nico Huber <nico.huber at secunet.com>
Date:   Thu Nov 22 11:12:13 2012 +0100

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

diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c
index 386392b..bf611d2 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) {




More information about the coreboot mailing list