]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/usbms.c: Retry on unknown errors.
authorAleš Nesrsta <starous@volny.cz>
Wed, 18 Dec 2013 18:00:45 +0000 (19:00 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 18 Dec 2013 18:00:45 +0000 (19:00 +0100)
Reuse the same tag on retries.

ChangeLog
grub-core/disk/usbms.c

index 3b899210de1370ac4ad1540de79ac63db41b2224..57cfe89b3657b6d9138b399b72674214362860d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-18  Aleš Nesrsta  <starous@volny.cz>
+
+       * grub-core/disk/usbms.c: Retry on unknown errors.
+       Reuse the same tag on retries.
+
 2013-12-18  Aleš Nesrsta  <starous@volny.cz>
 
        * grub-core/bus/usb/ehci.c: Fix handling of newborn transfers.
index 30756aee52963f8e3dbc532560bd5efe1e9d52ac..2b769bdd8e12eced68802798affa9d3bcd9f4ec6 100644 (file)
@@ -298,6 +298,8 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
   grub_usb_err_t errCSW = GRUB_USB_ERR_NONE;
   int retrycnt = 3 + 1;
   
+  tag++;
+
  retry:
   retrycnt--;
   if (retrycnt == 0)
@@ -306,7 +308,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
   /* Setup the request.  */
   grub_memset (&cbw, 0, sizeof (cbw));
   cbw.signature = grub_cpu_to_le32 (0x43425355);
-  cbw.tag = tag++;
+  cbw.tag = tag;
   cbw.transfer_length = grub_cpu_to_le32 (size);
   cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT;
   cbw.lun = scsi->lun; /* In USB MS CBW are LUN bits on another place than in SCSI CDB, both should be set correctly. */
@@ -335,7 +337,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
          grub_usb_clear_halt (dev->dev, dev->out->endp_addr);
          goto CheckCSW;
        }
-      return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed");
+      goto retry;
     }
 
   /* Read/write the data, (maybe) according to specification.  */