diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-08-02 10:14:52 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-08-02 10:14:52 +0000 |
commit | 699e34adeb63496bba9956e46a98b393ad68b94b (patch) | |
tree | d1f180fe6efc32d12812a5d48db4afa9e2bee157 | |
parent | 492e34a59041a04f92958139fee6ee4110a8cbe4 (diff) | |
download | edk2-platforms-699e34adeb63496bba9956e46a98b393ad68b94b.tar.xz |
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
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c index 32a85196ad..7452b55391 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c @@ -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--;
|