> -----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
> 
> This patch adds retries for async execution for commands that
> failed due to the CRC errors.
> 
> Cc: Hao A Wu <hao.a...@intel.com>
> Cc: Marcin Wojtas <m...@semihalf.com>
> Cc: Zhichao Gao <zhichao....@intel.com>
> Cc: Liming Gao <liming....@intel.com>
> 
> Signed-off-by: Mateusz Albecki <mateusz.albe...@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 != NULL) && (Status != EFI_NOT_READY)) {
> +  } else if ((Trb != NULL) && (Status == EFI_CRC_ERROR) && (Trb->Retries >
> 0)) {
> +    Trb->Retries--;
> +    Trb->Started = 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 timeout
value specified by the command packet.

Reviewed-by: Hao A Wu <hao.a...@intel.com>

Best Regards,
Hao Wu


> +  } else if ((Trb != NULL)) {
>      RemoveEntryList (Link);
>      Trb->Packet->TransactionStatus = Status;
>      TrbEvent = Trb->Event;
> --
> 2.14.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53130): https://edk2.groups.io/g/devel/message/53130
Mute This Topic: https://groups.io/mt/69499850/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to