EmbeddedPkg/MmcDxe: Avoid nanosecond delay when command succeeds

Check response just after receiving it to avoid the delay.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13584 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin 2012-08-02 10:14:52 +00:00
parent 492e34a590
commit 699e34adeb
1 changed files with 4 additions and 1 deletions

View File

@ -628,7 +628,10 @@ MmcIoBlocks (
while(!(Response[0] & MMC_R0_READY_FOR_DATA) && (MMC_R0_CURRENTSTATE(Response) != MMC_R0_STATE_TRAN) && Timeout--) {
Status = MmcHost->SendCommand (MmcHost, MMC_CMD13, CmdArg);
if (!EFI_ERROR(Status)) {
MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1,Response);
MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Response);
if ((Response[0] & MMC_R0_READY_FOR_DATA)) {
break; // Prevents delay once finished
}
}
NanoSecondDelay(100);
Timeout--;