From ef88e102bb4895753c8ba67e01ee26fdfe3fa712 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 21 Nov 2012 16:25:55 +0100 Subject: 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 Reviewed-on: http://review.coreboot.org/1900 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- payloads/libpayload/drivers/usb/usbmsc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'payloads') diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index 5cfb3c63cb..7e8b360758 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); -- cgit v1.2.3