]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UsbMass: Revert changes of removing retry logic
authorFeng Tian <feng.tian@intel.com>
Mon, 7 Nov 2016 07:46:16 +0000 (15:46 +0800)
committerFeng Tian <feng.tian@intel.com>
Mon, 14 Nov 2016 06:10:30 +0000 (14:10 +0800)
This patch is used to revert changes done in commit 17f3e942
bc527fbd75068d2d5752b6af54917487 - "MdeModulePkg/UsbMass: Not
retry if usb bot transfer execution fail"

It's because Usb Floppy will report DEVICE_ERROR for the first
several cmds when it need spin up. so retry logic makes sense.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c

index d5de1ac7d1a148c6294340ae92a9037f1cd11eac..0c46f888ebc84c041cb81a83ac2b087e5c87eb62 100644 (file)
@@ -189,11 +189,6 @@ UsbBootExecCmd (
     return EFI_TIMEOUT;\r
   }\r
 \r
-  if (Status == EFI_DEVICE_ERROR) {\r
-    DEBUG ((EFI_D_ERROR, "UsbBootExecCmd: Device Error to Exec 0x%x Cmd\n", *(UINT8 *)Cmd));\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
   //\r
   // If ExecCommand() returns no error and CmdResult is success,\r
   // then the commnad transfer is successful.\r
@@ -276,7 +271,7 @@ UsbBootExecCmdWithRetry (
                DataLen,\r
                Timeout\r
                );\r
-    if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA || Status == EFI_DEVICE_ERROR) {\r
+    if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA) {\r
       break;\r
     }\r
     //\r
index 4c29b611213dcbd0901b78b47fe3d988e3c050a5..4bb7222b89edd91c12610d9373c2bbe5f78b3eec 100644 (file)
@@ -2,7 +2,7 @@
   Implementation of the USB mass storage Bulk-Only Transport protocol,\r
   according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0.\r
 \r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -432,11 +432,7 @@ UsbBotExecCommand (
   // whether it succeeds or fails.\r
   //\r
   TransLen = (UINTN) DataLen;\r
-  Status   = UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout);\r
-  if (Status == EFI_DEVICE_ERROR) {\r
-    DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotDataTransfer (%r)\n", Status));\r
-    return Status;\r
-  }\r
+  UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout);\r
 \r
   //\r
   // Get the status, if that succeeds, interpret the result\r