From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 8210281DF9 for ; Mon, 7 Nov 2016 17:32:14 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 07 Nov 2016 17:32:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,459,1473145200"; d="scan'208";a="188800336" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 07 Nov 2016 17:32:17 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 7 Nov 2016 17:32:17 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 7 Nov 2016 17:32:16 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0248.002; Tue, 8 Nov 2016 09:32:14 +0800 From: "Zeng, Star" To: "Tian, Feng" , "edk2-devel@lists.01.org" Thread-Topic: [patch] MdeModulePkg/UsbMass: Revert changes of removing retry logic Thread-Index: AQHSOMtlnFxeNuF2eUyvAlFIBjHwYaDOTioQ Date: Tue, 8 Nov 2016 01:32:13 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB048310395970E1@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Tue, 08 Nov 2016 01:32:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Tian, Feng=20 Sent: Monday, November 7, 2016 3:49 PM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [patch] MdeModulePkg/UsbMass: Revert changes of removing retry log= ic 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 +------ MdeModul= ePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModu= lePkg/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; } =20 - if (Status =3D=3D 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 =3D=3D EFI_SUCCESS || Status =3D=3D EFI_MEDIA_CHANGED || St= atus =3D=3D EFI_NO_MEDIA || Status =3D=3D EFI_DEVICE_ERROR) { + if (Status =3D=3D EFI_SUCCESS || Status =3D=3D EFI_MEDIA_CHANGED || St= atus=20 + =3D=3D EFI_NO_MEDIA) { break; } // diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c b/MdeModul= ePkg/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. =20 -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 availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -432,11 +4= 32,7 @@ UsbBotExecCommand ( // whether it succeeds or fails. // TransLen =3D (UINTN) DataLen; - Status =3D UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeo= ut); - if (Status =3D=3D EFI_DEVICE_ERROR) { - DEBUG ((EFI_D_ERROR, "UsbBotExecCommand: UsbBotDataTransfer (%r)\n", S= tatus)); - return Status; - } + UsbBotDataTransfer (UsbBot, DataDir, Data, &TransLen, Timeout); =20 // // Get the status, if that succeeds, interpret the result -- 2.7.1.windows.2