\r
HsTiming = 1;\r
Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming, ClockFreq);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
\r
return Status;\r
}\r
EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru;\r
UINT32 Ocr;\r
UINT16 Rca;\r
+ UINTN Retry;\r
\r
PciIo = Private->PciIo;\r
PassThru = &Private->PassThru;\r
return Status;\r
}\r
\r
- Ocr = 0;\r
+ Ocr = 0;\r
+ Retry = 0;\r
do {\r
Status = EmmcGetOcr (PassThru, Slot, &Ocr);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
Ocr |= BIT30;\r
+\r
+ if (Retry++ == 100) {\r
+ DEBUG ((DEBUG_VERBOSE, "EmmcIdentification: Executing Cmd1 fails too many times\n"));\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+ gBS->Stall(10 * 1000);\r
} while ((Ocr & BIT31) == 0);\r
\r
Status = EmmcGetAllCid (PassThru, Slot);\r