On Sun, 11 Oct 2026 15:12:23 +0200 Igor Opaniuk <[email protected]>
wrote:
> sdhci_send_command() polls the interrupt status and gives up after
> SDHCI_READ_STATUS_TIMEOUT, but it evaluates the timeout before it looks at
> the status it has just read. When a single status read takes longer than
> the timeout, the command is reported as timed out although the response
> and transfer-complete bits are already set, and the caller aborts an
> otherwise successful transfer.
>
> This happens on QEMU's SDHCI/eMMC model under TCG: a large ADMA transfer
> runs in a timer callback while holding the big QEMU lock, so U-Boot's next
> MMIO read blocks for seconds and the subsequent command appears to have
> timed out ("Timeout for status update: 00000003 00000001").
>
> Check for completion first and only then for the timeout.
>
> Signed-off-by: Igor Opaniuk <[email protected]>
LGTM:
Reviewed-by: Peng Fan <[email protected]>