From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C395081E78 for ; Sun, 6 Nov 2016 23:48:38 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP; 06 Nov 2016 23:48:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,605,1473145200"; d="scan'208";a="28267589" Received: from shwdeftian.ccr.corp.intel.com ([10.239.158.36]) by fmsmga005.fm.intel.com with ESMTP; 06 Nov 2016 23:48:40 -0800 From: Feng Tian To: edk2-devel@lists.01.org Cc: star.zeng@intel.com Date: Mon, 7 Nov 2016 15:48:31 +0800 Message-Id: X-Mailer: git-send-email 2.7.1.windows.2 Subject: [patch] MdeModulePkg/UsbMass: Revert changes of removing retry logic X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 07:48:38 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian --- MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c | 7 +------ MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c index d5de1ac..0c46f88 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c @@ -189,11 +189,6 @@ UsbBootExecCmd ( return EFI_TIMEOUT; } - if (Status == EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "UsbBootExecCmd: Device Error to Exec 0x%x Cmd\n", *(UINT8 *)Cmd)); - return EFI_DEVICE_ERROR; - } - // // If ExecCommand() returns no error and CmdResult is success, // then the commnad transfer is successful. @@ -276,7 +271,7 @@ UsbBootExecCmdWithRetry ( DataLen, Timeout ); - if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA || Status == EFI_DEVICE_ERROR) { + if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA) { break; } // diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c index 4c29b61..4bb7222 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c @@ -2,7 +2,7 @@ Implementation of the USB mass storage Bulk-Only Transport protocol, according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0. -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -432,11 +432,7 @@ UsbBotExecCommand ( // whether it succeeds or fails. // TransLen = (UINTN) DataLen; - Status = UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout); - if (Status == EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotDataTransfer (%r)\n", Status)); - return Status; - } + UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout); // // Get the status, if that succeeds, interpret the result -- 2.7.1.windows.2