From 8c4d2f36a339ba34c532e29696f2c5b70fb04957 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Tue, 20 Nov 2012 17:49:00 +0100 Subject: libpayload: Handle underruns in UHCI interrupt queues If usb_poll() isn't called fast enough, the UHCI controller marks an underrun interrupt queue as done (terminating the queue at the head). We can recover from this situation, when usb_poll() gets called again, and the queue is processed. Change-Id: Id56c9df44d6dbd53cd30ad89dfb5bf5977799829 Signed-off-by: Nico Huber Reviewed-on: http://review.coreboot.org/1898 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/libpayload/drivers/usb/uhci.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'payloads/libpayload/drivers') diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c index bfa53f6049..386392b53f 100644 --- a/payloads/libpayload/drivers/usb/uhci.c +++ b/payloads/libpayload/drivers/usb/uhci.c @@ -590,6 +590,11 @@ uhci_poll_intr_queue (void *q_) q->lastread = (q->lastread + 1) % q->total; return &q->data[current*q->reqsize]; } + /* reset queue if we fully processed it after underrun */ + else if (q->qh->elementlinkptr & FLISTP_TERMINATE) { + usb_debug("resetting underrun uhci interrupt queue.\n"); + q->qh->elementlinkptr = virt_to_phys(q->tds + q->lastread); + } return NULL; } -- cgit v1.2.3