AW: [PATCH] mmc: Fix missing 1 ms delay after mmc power up

E Shattow e at freeshell.de
Wed Nov 12 21:25:36 CET 2025



On 11/12/25 10:13, Christoph Stoidner wrote:
> Hello,  sorry, did you send that mail only direct to me? I cannot find it in the Mailinglist.
> 
> I don't want to bother you. However would you mind to send it also to the list, to have it transparent for all?
> 
> Regards,
> Christoph

Okay, sorry I missed this before. CC: U-Boot Mailing List

-E

> 
> 
> ________________________________
> Von: E Shattow <e at freeshell.de>
> Gesendet: Freitag, 31. Oktober 2025 22:27
> An: Christoph Stoidner <c.stoidner at phytec.de>
> Betreff: Re: [PATCH] mmc: Fix missing 1 ms delay after mmc power up
> 
> 
> On 10/31/25 07:59, Christoph Stoidner wrote:
>> mmc/sd specification requires a 1 ms delay (stable supply voltage)
>> after vdd was enabled and before issuing first command.
>>
>> For most sdcard/soc combinations, the missing delay seems to be not a
>> problem because the processing time between enabling vdd and the first
>> command is often hundreds of microseconds or more. However, in our
>> specific case, some sdcards were not detected by u-boot:
>> * soc: NXP i.MX 93
>> * sdcards: SanDisk Ultra, 64GB micro SDXC 1,
>>            MediaRange, 8GB, SDHC
>> * measured time between vdd and first command: approx. 784us
>> * symptom: both sdcards did not respond at all to first commands,
>>            u-boot mmc subsystem ran into timeout and stops to
>>            initialize the cards
>>
>> Signed-off-by: Christoph Stoidner <c.stoidner at phytec.de>
>> Cc: Peng Fan <peng.fan at nxp.com>
>> Cc: Jaehoon Chung <jh80.chung at samsung.com>
>> ---
>>  drivers/mmc/mmc.c | 13 ++++++++++---
>>  1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>> index ec61ed92e86..2093d169094 100644
>> --- a/drivers/mmc/mmc.c
>> +++ b/drivers/mmc/mmc.c
>> @@ -2878,11 +2878,18 @@ static int mmc_power_cycle(struct mmc *mmc)
>>                return ret;
>>
>>        /*
>> -      * SD spec recommends at least 1ms of delay. Let's wait for 2ms
>> -      * to be on the safer side.
>> +      * SD spec recommends at least 1ms of 'power on' delay.
>> +      * Let's wait for 2ms to be on the safer side.
>>         */
>>        udelay(2000);
>> -     return mmc_power_on(mmc);
>> +     ret = mmc_power_on(mmc);
>> +
>> +     /*
>> +      * SD spec recommends at least 1ms of 'stable supply voltage' delay.
>> +      * Let's wait for 2ms to be on the safer side.
>> +      */
>> +     udelay(2000);
>> +     return ret;
>>  }
>>
>>  int mmc_get_op_cond(struct mmc *mmc, bool quiet)
> 
> Let's do what it says. Would udelay(1000) ever possibly complete faster
> than the recommended time in the specification ?
> 
>          /*
> -        * SD spec recommends at least 1ms of delay. Let's wait for 2ms
> -        * to be on the safer side.
> +        * SD spec requires:
> +        * 1ms of delay 'power on' before power on
> +        * 1ms of 'stable supply voltage' after power on
>           */
>          udelay(1000);
> -       return mmc_power_on(mmc);
> +       ret = mmc_power_on(mmc);
> +       udelay(1000);
> +       return ret;
>  }
> 
> To follow the specification recommendations exactly?
> 
> Also, why add the delay before returning from mmc_power_on() in
> mmc_power_cycle() and not in mmc_power_on() itself?
> 
> -E
> 



More information about the U-Boot mailing list