Devicetree
 help / color / mirror / Atom feed
From: Judith Mendez <jm@ti.com>
To: Ulf Hansson <ulf.hansson@oss.qualcomm.com>
Cc: Ulf Hansson <ulfh@kernel.org>, Rob Herring <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, <linux-mmc@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] mmc: core: Add power-off-delay-us support
Date: Tue, 28 Jul 2026 16:56:35 -0500	[thread overview]
Message-ID: <307ee173-81ae-4434-aee4-9ddbbc9e6890@ti.com> (raw)
In-Reply-To: <CAPx+jO9w0utg5BhsKnUSgdCWeM1prOqoV0gCrTpaeuaWZouXoA@mail.gmail.com>

Hi Ulf,

On 7/27/26 10:16 AM, Ulf Hansson wrote:
> On Wed, Jul 22, 2026 at 10:57 PM Judith Mendez <jm@ti.com> wrote:
>>
>> Add support for power-off-delay-us which shall be used to specify
>> value of delay after deasserting power during MMC power cycles.
>> Default for delay is 1000us but custom delay can be passed in to work
>> around hardware issues such as slow RC discharge on MMC VDD rails.
>>
>> Signed-off-by: Judith Mendez <jm@ti.com>
>> ---
>> Changes since v1:
>> - Move delay to mmc_power_off
>> - Fix dt checks and remove print
>> - Move from mmc_host struct to mmc_ios struct
>> - Rename post-power-off-delay-ms to power_off_delay_us
>> ---
>>   drivers/mmc/core/core.c  | 2 +-
>>   drivers/mmc/core/host.c  | 8 ++++++++
>>   include/linux/mmc/host.h | 1 +
>>   3 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 29e80e5f928e9..9472041fe1c20 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -1388,7 +1388,7 @@ void mmc_power_off(struct mmc_host *host)
>>           * XO-1.5, require a short delay after poweroff before the card
>>           * can be successfully turned on again.
>>           */
>> -       mmc_delay(1);
>> +       mmc_delay_us(host->ios.power_off_delay_us);
>>   }
>>
>>   void mmc_power_cycle(struct mmc_host *host, u32 ocr)
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index b7ce3137d4529..fac50a2860211 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -421,6 +421,13 @@ int mmc_of_parse(struct mmc_host *host)
>>          device_property_read_u32(dev, "post-power-on-delay-ms",
>>                                   &host->ios.power_delay_ms);
>>
>> +       device_property_read_u32(dev, "power-off-delay-us",
>> +                                &host->ios.power_off_delay_us);
>> +       if (host->ios.power_off_delay_us < 1)
>> +               host->ios.power_off_delay_us = 1000;
> 
> If power-off-delay-us is specified and the value >= 0, I think we can
> respect it as is.
> 
> This means we need to treat "0" a bit special and bail out in mmc_delay_us().

Ok, just to confirm, then, you want to drop these guards in mmc_of_parse
and instead catch 0 in mmc_power_off?

What if DT parse gets garbled and host->ios.power_off_delay_us < 1 is
passed?

~ Judith

...

      reply	other threads:[~2026-07-28 21:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 20:56 [PATCH v2 0/3] mmc: Add power_off_delay_us support Judith Mendez
2026-07-22 20:56 ` [PATCH v2 1/3] dt-bindings: mmc: Add power-off-delay-us property Judith Mendez
2026-07-22 20:57 ` [PATCH v2 2/3] mmc: core: Add mmc_delay_us() for microsecond precision delays Judith Mendez
2026-07-22 21:04   ` sashiko-bot
2026-07-24 22:17   ` Sebastian Reichel
2026-07-28 22:28     ` Judith Mendez
2026-07-22 20:57 ` [PATCH v2 3/3] mmc: core: Add power-off-delay-us support Judith Mendez
2026-07-22 21:06   ` sashiko-bot
2026-07-27 15:16   ` Ulf Hansson
2026-07-28 21:56     ` Judith Mendez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=307ee173-81ae-4434-aee4-9ddbbc9e6890@ti.com \
    --to=jm@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@oss.qualcomm.com \
    --cc=ulfh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox