]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Add retries for async commands
authorAlbecki, Mateusz <mateusz.albecki@intel.com>
Tue, 14 Jan 2020 12:05:30 +0000 (20:05 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 19 Jan 2020 01:58:00 +0000 (01:58 +0000)
This patch adds retries for async execution for commands that
failed due to the CRC errors.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Marcin Wojtas <mw@semihalf.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c

index 193b0f24e229df207d2da7a410608bcb862ee81d..b18ff3e97205bd37bf4d4f89bea79de2ae42df56 100644 (file)
@@ -211,8 +211,10 @@ Done:
       gBS->SignalEvent (TrbEvent);\r
       return;\r
     }\r
-  }\r
-  if ((Trb != NULL) && (Status != EFI_NOT_READY)) {\r
+  } else if ((Trb != NULL) && (Status == EFI_CRC_ERROR) && (Trb->Retries > 0)) {\r
+    Trb->Retries--;\r
+    Trb->Started = FALSE;\r
+  } else if ((Trb != NULL)) {\r
     RemoveEntryList (Link);\r
     Trb->Packet->TransactionStatus = Status;\r
     TrbEvent = Trb->Event;\r