Hello Brian Nemec,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/41152
to review the following change.
Change subject: Subject: raiden_debug_spi.c: Disable USB retry during some error codes ......................................................................
Subject: raiden_debug_spi.c: Disable USB retry during some error codes
Enables the USB SPI transfer retry mechanism when the write count error code is returned. This error code can indicate a recoverable transfer failure.
BUG=b:153887087 BRANCH=none TEST=Manual testing of ServoMicro and Flashrom when performing reads, writes, and verifications of the EC firmware on Nami. TEST=Modified servo micro to produce periodic errors when reading the packet length to verify the recovery is successful.
Change-Id: I9e6b2ccec0b06aab0d6920f1bddf108058e5d6b1 --- M raiden_debug_spi.c 1 file changed, 7 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/52/41152/1
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c index 2127f69..ac74c0b 100644 --- a/raiden_debug_spi.c +++ b/raiden_debug_spi.c @@ -188,9 +188,13 @@ static bool retry_recovery(int error_code) { if (error_code < 0x10000) { - /* Handle error codes returned from the device. */ - if (USB_SPI_WRITE_COUNT_INVALID <= error_code && - error_code <= USB_SPI_DISABLED) { + /* + * Handle error codes returned from the device. USB_SPI_TIMEOUT, + * USB_SPI_BUSY, and USB_SPI_WRITE_COUNT_INVALID have been observed + * during transfer errors to the device and can be recovered. + */ + if (USB_SPI_READ_COUNT_INVALID <= error_code && + error_code <= USB_SPI_DISABLED) { return false; } } else if (usb_device_is_libusb_error(error_code)) {