[U-Boot] [PATCH v2] mmc: fsl_esdhc: Avoid infinite loop in esdhc_send_cmd_common()

Fabio Estevam festevam at gmail.com
Mon Nov 19 14:41:49 UTC 2018


Hi Ricardo,

On Mon, Nov 19, 2018 at 12:25 PM Ricardo Salveti <rsalveti at rsalveti.net> wrote:

> Looking a bit further, this ends up adding a significant boot delay
> because the mmc driver still tries to send another two additional
> commands, so it ends executing this timeout logic 3 times in total.
> Guess this can be improved at
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c;h=d6b9cdc99229d8bfe0c8be3adfd6e5209a11601c;hb=HEAD#l2633
> by either checking for mmc first or by simply just checking and
> handling the return code from mmc_send_if_cond, but this could be
> another patch.

Yes, I think you are right.

Does only adding the error check below avoid the hang in your case?

        /* Test for SD version 2 */
         err = mmc_send_if_cond(mmc);
         if (err)
            return err;

Thanks


More information about the U-Boot mailing list