From: sashiko-bot@kernel.org
To: "Judith Mendez" <jm@ti.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: core: Add post-power-off-delay-ms support
Date: Thu, 16 Jul 2026 23:37:05 +0000 [thread overview]
Message-ID: <20260716233705.96B831F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260716232641.2659710-3-jm@ti.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The `post-power-off-delay-ms` hardware constraint is only enforced in `mmc_power_cycle()`, leaving decoupled power-off/power-on sequences vulnerable to hardware timing violations.
- [Low] Explicitly configuring a 0 ms post-power-off delay in the device tree is ignored, falling back to the 1 ms default.
--
--- Patch [2]: [PATCH 2/2] mmc: core: Add post-power-off-delay-ms support ---
commit 36ce7de56b9b7e7608c56353aede4cb3de73df5b
Author: Judith Mendez <jm@ti.com>
mmc: core: Add post-power-off-delay-ms support
This commit adds support for post-power-off-delay-ms, allowing a
configurable delay after an MMC power off.
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 29e80e5f928e9..f9049aaf44394 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1394,8 +1394,12 @@ void mmc_power_off(struct mmc_host *host)
> void mmc_power_cycle(struct mmc_host *host, u32 ocr)
> {
> mmc_power_off(host);
> - /* Wait at least 1 ms according to SD spec */
> - mmc_delay(1);
> + if (host->post_power_off_delay_ms) {
> + mmc_delay(host->post_power_off_delay_ms);
> + } else {
> + /* Wait at least 1 ms according to SD spec */
> + mmc_delay(1);
> + }
[Severity: Medium]
Will this delay be missed for decoupled power-off and power-on sequences?
If a device relies on post-power-off-delay-ms (e.g., 100ms) but goes through a
runtime PM suspend or system suspend, mmc_power_off() will be called, followed
later by mmc_power_up(). Because the delay is only enforced here in
mmc_power_cycle(), will the decoupled off/on path violate the power-off time
constraint?
Could mmc_power_off() record a timestamp, and mmc_power_up() calculate the
elapsed time to only delay the remaining required duration?
[Severity: Low]
Does this ignore an explicitly configured 0 ms delay?
If a developer explicitly specifies post-power-off-delay-ms = <0> in the
device tree, this condition will evaluate to false and unexpectedly fall
back to the 1 ms default.
Could this be resolved by initializing the default value in mmc_alloc_host()
and removing the if/else condition here?
> mmc_power_up(host, ocr);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260716232641.2659710-1-jm@ti.com?part=2
prev parent reply other threads:[~2026-07-16 23:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 23:26 [PATCH 0/2] mmc: Add post-power-off-delay-ms support Judith Mendez
2026-07-16 23:26 ` [PATCH 1/2] dt-bindings: mmc: Add post-power-off-delay-ms property Judith Mendez
2026-07-17 0:35 ` Rob Herring (Arm)
2026-07-16 23:26 ` [PATCH 2/2] mmc: core: Add post-power-off-delay-ms support Judith Mendez
2026-07-16 23:37 ` sashiko-bot [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=20260716233705.96B831F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jm@ti.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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