Devicetree
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Kamal Dasu <kamal.dasu@broadcom.com>
Cc: Ulf Hansson <ulfh@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Avri Altman <avri.altman@sandisk.com>,
	Pedro Demarchi Gomes <pedrodemargomes@gmail.com>,
	Erick Shepherd <erick.shepherd@ni.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	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 v3 1/2] dt-bindings: mmc: Document no-mmc-poweroff-suspend property
Date: Thu, 23 Jul 2026 21:01:17 +0200	[thread overview]
Message-ID: <1a9d18ce-e6dc-40e0-aa2a-e27f694e1217@kernel.org> (raw)
In-Reply-To: <CAKekbevxiN=8q60sHkRLKzEwc75PYHO7nJtMEahLF+u39g-FBw@mail.gmail.com>

On 23/07/2026 20:53, Kamal Dasu wrote:
> On Thu, Jul 23, 2026 at 3:51 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
>> On Wed, Jul 22, 2026 at 05:14:16PM -0400, Kamal Dasu wrote:
>>> On some platforms, firmware accesses the (e)MMC card directly during
>>> system resume from Suspend-to-DRAM, before the kernel's own resume
>>> path has run, in order to load boot code using hard wired logic that
>>> is not field updatable. This requires the card to remain powered
>>> and responsive throughout suspend: it cannot be put to sleep, sent a
>>> power-off notification, or have its supply removed.
>>>
>>> Add a no-mmc-poweroff-suspend flag property so affected boards can
>>> tell the mmc core to keep the card powered across suspend instead of
>>> sleeping or powering it off.
>>>
>>> Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
>>> ---
>>> Changes in v3:
>>>   - Renamed from no-mmc-sleep; dropped S_A_TIMEOUT framing per Ulf.
>>>
>>> Changes in v2:
>>>   - New patch, replacing v1's card-level quirk, per Ulf.
>>>
>>>  .../devicetree/bindings/mmc/mmc-controller-common.yaml | 10 ++++++++++
>>>  1 file changed, 10 insertions(+)
>>>
>>> diff --git
>> a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
>> b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
>>> index 3d7195e9461c..5f7b3f8ef1dd 100644
>>> --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
>>> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
>>> @@ -232,6 +232,16 @@ properties:
>>>      description:
>>>        All eMMC HS400 modes are not supported.
>>>
>>> +  no-mmc-poweroff-suspend:
>>> +    $ref: /schemas/types.yaml#/definitions/flag
>>> +    description:
>>> +      On this platform, firmware accesses the attached (e)MMC card
>>> +      directly during system resume, before the kernel's own resume
>>> +      path runs. The card must therefore stay powered throughout
>>> +      suspend, and the controller must not send it a sleep or
>>> +      power-off notification. The kernel re-initializes the card
>>> +      after resume, since firmware may have already reset it.
>>
>> Isn't this exactly the same as keep-power-in-suspend?
>>
>>
> Not quite, though I see why it reads that way from the description
> alone.
> 
> keep-power-in-suspend only takes effect through host->pm_flags, which
> gets set at runtime via sdio_set_host_pm_flags() -- an SDIO function
> driver opts in from its own suspend() callback, per suspend cycle.
> The consuming logic lives entirely in mmc_sdio_suspend()/
> mmc_sdio_resume() (drivers/mmc/core/sdio.c); pm_flags is never read
> in mmc.c, which is what this series touches.
> 
> no-mmc-poweroff-suspend differs in two ways:
> 
>   - It's a fixed platform characteristic, not a per-driver runtime
>     request. There's no SDIO-style function driver to call an opt-in
>     API from for a plain (e)MMC storage card -- the requirement here
>     (firmware always touches the card at resume, on this board) is
>     always true, not something decided per suspend cycle.
>   - The resume-side behavior differs. keep-power-in-suspend without a
>     wake IRQ does nothing at resume: it assumes the card's state
>     survived untouched. This flag needs the opposite -- keep power,
>     but still fully re-initialize the card via mmc_init_card(), since
>     firmware may have reconfigured it while the kernel was suspended.

All this is just driver stuff which I did not ask about.

The property is described pretty the same - do not power off during
suspend/resume.



Best regards,
Krzysztof

  reply	other threads:[~2026-07-23 19:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 21:14 [PATCH v3 0/2] mmc: core: Keep the card powered across suspend when firmware needs it live Kamal Dasu
2026-07-22 21:14 ` [PATCH v3 1/2] dt-bindings: mmc: Document no-mmc-poweroff-suspend property Kamal Dasu
2026-07-23  7:51   ` Krzysztof Kozlowski
2026-07-23 18:53     ` Kamal Dasu
2026-07-23 19:01       ` Krzysztof Kozlowski [this message]
2026-07-23 19:24         ` Kamal Dasu
2026-07-23 19:36           ` Krzysztof Kozlowski
2026-07-23 19:50             ` Kamal Dasu
2026-07-22 21:14 ` [PATCH v3 2/2] mmc: core: Add MMC_CAP2_NO_POWEROFF_SUSPEND host capability Kamal Dasu
2026-07-22 21:24   ` 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=1a9d18ce-e6dc-40e0-aa2a-e27f694e1217@kernel.org \
    --to=krzk@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@sandisk.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=erick.shepherd@ni.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=kamal.dasu@broadcom.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pedrodemargomes@gmail.com \
    --cc=robh@kernel.org \
    --cc=ulfh@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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