Nico Huber (nico.huber@secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1900
-gerrit
commit 3fb1e361abf89f27f3f86203e6830e9d14ae9bdb Author: Nico Huber nico.huber@secunet.com Date: Wed Nov 21 16:25:55 2012 +0100
libpayload: More compliant error recovery in USB MSC
If an endpoint gets stalled by an MSC device, after successful transmission of a command (CBW), we should still ask for the status (CSW). Otherwise, the driver and the device get desynchronized on the command tags.
Change-Id: I53167f22c43b3a237cb4539b3affe37799378b93 Signed-off-by: Nico Huber nico.huber@secunet.com --- payloads/libpayload/drivers/usb/usbmsc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index 5cfb3c6..7e8b360 100644 --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -227,16 +227,12 @@ execute_command (usbdev_t *dev, cbw_direction dir, const u8 *cb, int cblen, if (buflen > 0) { if (dir == cbw_direction_data_in) { if (dev->controller-> - bulk (MSC_INST (dev)->bulk_in, buflen, buf, 0)) { + bulk (MSC_INST (dev)->bulk_in, buflen, buf, 0)) clear_stall (MSC_INST (dev)->bulk_in); - return MSC_COMMAND_FAIL; - } } else { if (dev->controller-> - bulk (MSC_INST (dev)->bulk_out, buflen, buf, 0)) { + bulk (MSC_INST (dev)->bulk_out, buflen, buf, 0)) clear_stall (MSC_INST (dev)->bulk_out); - return MSC_COMMAND_FAIL; - } } } int ret = get_csw (MSC_INST (dev)->bulk_in, &csw);