From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web12.6297.1578634668294041632 for ; Thu, 09 Jan 2020 21:37:54 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 21:37:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,415,1571727600"; d="scan'208";a="272302583" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jan 2020 21:37:54 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Jan 2020 21:37:54 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Jan 2020 21:37:53 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.197]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Fri, 10 Jan 2020 13:37:51 +0800 From: "Wu, Hao A" To: "Albecki, Mateusz" , "devel@edk2.groups.io" CC: Marcin Wojtas , "Gao, Zhichao" , "Gao, Liming" Subject: Re: [PATCH 3/3] MdeModulePkg/SdMmcPciHcDxe: Add retries for async commands Thread-Topic: [PATCH 3/3] MdeModulePkg/SdMmcPciHcDxe: Add retries for async commands Thread-Index: AQHVxUqWGMtk9/Rd00OWKzi2vqFo1KfiBSgg Date: Fri, 10 Jan 2020 05:37:51 +0000 Message-ID: References: <20200107110621.232-1-mateusz.albecki@intel.com> <20200107110621.232-4-mateusz.albecki@intel.com> In-Reply-To: <20200107110621.232-4-mateusz.albecki@intel.com> 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 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Albecki, Mateusz > Sent: Tuesday, January 07, 2020 7:06 PM > To: devel@edk2.groups.io > Cc: Albecki, Mateusz; Wu, Hao A; Marcin Wojtas; Gao, Zhichao; Gao, Liming > Subject: [PATCH 3/3] MdeModulePkg/SdMmcPciHcDxe: Add retries for async > commands >=20 > This patch adds retries for async execution for commands that > failed due to the CRC errors. >=20 > Cc: Hao A Wu > Cc: Marcin Wojtas > Cc: Zhichao Gao > Cc: Liming Gao >=20 > Signed-off-by: Mateusz Albecki > --- > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > index 193b0f24e2..b18ff3e972 100644 > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c > @@ -211,8 +211,10 @@ Done: > gBS->SignalEvent (TrbEvent); > return; > } > - } > - if ((Trb !=3D NULL) && (Status !=3D EFI_NOT_READY)) { > + } else if ((Trb !=3D NULL) && (Status =3D=3D EFI_CRC_ERROR) && (Trb->R= etries > > 0)) { > + Trb->Retries--; > + Trb->Started =3D FALSE; I think it is fine to let the 'Trb->Timeout' field not being reset here. My take is that all the potential retries should be restricted by the timeo= ut value specified by the command packet. Reviewed-by: Hao A Wu Best Regards, Hao Wu > + } else if ((Trb !=3D NULL)) { > RemoveEntryList (Link); > Trb->Packet->TransactionStatus =3D Status; > TrbEvent =3D Trb->Event; > -- > 2.14.1.windows.1