Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kamal Dasu" <kamal.dasu@broadcom.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 1/2] dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO
Date: Wed, 29 Jul 2026 20:23:36 +0000	[thread overview]
Message-ID: <20260729202336.CABD11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260729201420.4047677-2-kamal.dasu@broadcom.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The commit documents `keep-power-in-suspend` as a supported contract for (e)MMC platforms to preserve power during suspend, but the MMC core does not implement this behavior for non-SDIO cards, resulting in a false contract. The MMC core will unconditionally power off the card during suspend, breaking firmware that relies on the card remaining powered.
--

--- Patch [1]: [PATCH v5 1/2] dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO ---
commit 4c90177be3ef2dae76dde526bf579376039fcb17
Author: Kamal Dasu <kamal.dasu@broadcom.com>

dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO

This commit drops the "SDIO only" restriction for the keep-power-in-suspend
property in the MMC device tree bindings. It updates the documentation to
state that for (e)MMC devices, this property indicates a platform requirement
where firmware accesses the card directly during resume.

> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
> --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
> @@ -291,7 +291,12 @@ properties:
>    keep-power-in-suspend:
>      $ref: /schemas/types.yaml#/definitions/flag
>      description:
> -      SDIO only. Preserves card power during a suspend/resume cycle.
> +      Preserves card power during a suspend/resume cycle. For SDIO,
> +      this is a request an individual function driver can make at
> +      runtime via sdio_set_host_pm_flags(). For (e)MMC, it is instead
> +      a fixed platform characteristic, needed on boards where firmware
> +      accesses the card directly during system resume, before the
> +      kernel's own resume path runs.

[Severity: High]
Does the MMC core actually support keeping power for non-SDIO cards during
suspend?

Looking at the implementation in drivers/mmc/core/mmc.c, _mmc_suspend()
appears to unconditionally power off the card:

drivers/mmc/core/mmc.c:_mmc_suspend() {
        ...
        if (!err) {
                mmc_power_off(host);
                mmc_card_set_suspended(host->card);
        }
}

Unlike the SDIO suspend path, it lacks a check for mmc_card_keep_power(host).
Without this check, won't the kernel still power off the card during suspend
even if keep-power-in-suspend is defined in the device tree? 

If firmware attempts to access the unpowered MMC device during early resume
because it expects this DT contract to be honored, could this result in a
system crash or resume hang?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260729201420.4047677-1-kamal.dasu@broadcom.com?part=1

  reply	other threads:[~2026-07-29 20:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 20:14 [PATCH v5 0/2] mmc: core: Keep the card powered across suspend when firmware needs it live Kamal Dasu
2026-07-29 20:14 ` [PATCH v5 1/2] dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO Kamal Dasu
2026-07-29 20:23   ` sashiko-bot [this message]
2026-07-29 20:14 ` [PATCH v5 2/2] mmc: core: Honor keep-power-in-suspend for (e)MMC in suspend/resume Kamal Dasu
2026-07-29 20:29   ` sashiko-bot

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=20260729202336.CABD11F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kamal.dasu@broadcom.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