[PATCH v2 1/5] mmc: fix mmc_poll_for_busy() false timeout when card is ready

Kathpalia, Tanmay tanmay.kathpalia at altera.com
Mon Jul 13 19:47:02 CEST 2026


On 7/13/2026 7:02 PM, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>
>
> mmc_poll_for_busy() returns a false -ETIMEDOUT if the card becomes
> ready on the exact iteration where timeout_ms reaches 0. The card-ready
> check breaks out of the loop, but then the post-loop check
> "if (timeout_ms <= 0)" fires and returns -ETIMEDOUT despite the card
> being ready.
>
> Fix by returning 0 directly when the card is ready instead of breaking
> out of the loop. The only exit from the loop is now the timeout path,
> so the post-loop code unconditionally returns -ETIMEDOUT.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>

Reviewed-by: Tanmay Kathpalia <tanmay.kathpalia at altera.com>

>


More information about the U-Boot mailing list