I have a patch in uefi-next.git that makes this a little better, but still doesn't solve the problem.
Investigating the MMC stack in UEFI, if a block read times out, the stack will abort immediately with no retries. I added a retry loop in a couple of different placed, however, neither worked.
The code in question is:
EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c, circa line 659:
if (Transfer == MMC_IOBLOCKS_READ) {
// Read one block of Data
Status = MmcHost->ReadBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer);
gBS->RestoreTPL(Tpl) ;
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Read Block Data and Status = %r\n", Status)); MmcStopTransmission(MmcHost) ;
return Status;
}
And MmcHost->ReadBlockData() is a call into:
ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c, circa line 208, with the timeout code here:
//Check for error conditions and timeouts
if (Status & MCI_STATUS_CMD_DATATIMEOUT) {
DEBUG ((EFI_D_ERROR, "MciReadBlockData(): TIMEOUT! Response:0x%X Status:0x%x\n", MmioRead32 (MCI_RESPONSE0_REG), Status));
RetVal = EFI_TIMEOUT;
break;
} ...
Note, both places make no attempt to handle the timeout, they simply drop out in error.
I have a patch in uefi-next.git that makes this a little better, but still doesn't solve the problem.
Investigating the MMC stack in UEFI, if a block read times out, the stack will abort immediately with no retries. I added a retry loop in a couple of different placed, however, neither worked.
The code in question is:
EmbeddedPkg/ Universal/ MmcDxe/ MmcBlockIo. c, circa line 659:
if (Transfer == MMC_IOBLOCKS_READ) { >ReadBlockData (MmcHost, Lba, This->Media- >BlockSize, Buffer); >RestoreTPL( Tpl) ;
MmcStopTransmi ssion(MmcHost) ;
// Read one block of Data
Status = MmcHost-
gBS-
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Read Block Data and Status = %r\n", Status));
return Status;
}
And MmcHost- >ReadBlockData( ) is a call into:
ArmPlatformPkg/ Drivers/ PL180MciDxe/ PL180Mci. c, circa line 208, with the timeout code here:
//Check for error conditions and timeouts CMD_DATATIMEOUT ) { ta(): TIMEOUT! Response:0x%X Status:0x%x\n", MmioRead32 (MCI_RESPONSE0_ REG), Status));
if (Status & MCI_STATUS_
DEBUG ((EFI_D_ERROR, "MciReadBlockDa
RetVal = EFI_TIMEOUT;
break;
} ...
Note, both places make no attempt to handle the timeout, they simply drop out in error.