UEFI: TC2: booting from A7 core causes boot failures due to MMC/SD timeouts

Bug #1179461 reported by Ryan Harkin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro UEFI
Invalid
Medium
Ryan Harkin

Bug Description

On switching from A15 to A17 booting, UEFI on TC2 become unreliable due to MMC/SD card timeouts.

Testing shows that the board will boot 100% of the time from A15, and approximately 80% of the time from A7.

This was discovered after updating the firmware in LAVA:

BUG: "vexpress-tc2 target boards need a change in firmware to boot on to A7"
https://bugs.launchpad.net/lava-lab/+bug/1171829

Tags: tc2 uefi vexpress
Revision history for this message
Ryan Harkin (ryanharkin) wrote :

The following timeout message is also thrown intermittently:

MciReadBlockData(): TIMEOUT! Response:0xA404012 Status:0x48

Revision history for this message
Ryan Harkin (ryanharkin) wrote :

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.

Ryan Harkin (ryanharkin)
Changed in linaro-uefi:
milestone: 13.05 → 13.06
Fathi Boudra (fboudra)
Changed in linaro-uefi:
milestone: 13.06 → 13.07
Fathi Boudra (fboudra)
Changed in linaro-uefi:
milestone: 13.07 → 13.08
Fathi Boudra (fboudra)
Changed in linaro-uefi:
milestone: 13.08 → 13.09
Fathi Boudra (fboudra)
Changed in linaro-uefi:
milestone: 13.09 → 13.10
Revision history for this message
Fathi Boudra (fboudra) wrote :

As discussed with Ryan, set priority to medium and remove the targeted milestone.

Changed in linaro-uefi:
importance: Critical → Medium
milestone: 13.10 → none
Revision history for this message
Ryan Harkin (ryanharkin) wrote :

This problem no longer happens with the latest code.

Changed in linaro-uefi:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.