mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	Ulf Hansson <ulfh@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	<linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [RESEND PATCH 1/7] dt-bindings: power: st: add STM32MP PM domain binding
Date: Mon, 23 Nov 2026 18:53:33 +0100	[thread overview]
Message-ID: <7493faea-092a-412b-8332-8fd68d20057e@foss.st.com> (raw)
In-Reply-To: <20261123-pretty-strict-caracara-bfcaac@quoll>

Hi,
On 11/23/26 12:11, Krzysztof Kozlowski wrote:
>On Mon, Nov 16, 2026 at 11:40:26AM +0100, Patrick Delaunay wrote:
>>Add binding documentation for the power domains found on
>>STMicroelectronics STM32MP SoCs.
>
>A nit, subject: drop second/last, redundant "binding". The
>"dt-bindings" prefix is already stating that these are bindings.
>See also:
>https://elixir.bootlin.com/linux/v7.1-rc7/source/Documentation/devicetree/bindings/submitting-patches.rst#L23
Thanks for the review. I will drop the redundant “binding” from the 
subject and
move additionalProperties: false below the required block.
>
>
>>
>>Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>>---
>>
>>.../bindings/power/st,stm32mp-pm-domain.yaml | 46 +++++++++++++++++++
>>1 file changed, 46 insertions(+)
>>create mode 100644 
Documentation/devicetree/bindings/power/st,stm32mp-pm-domain.yaml
>>
>>diff --git 
a/Documentation/devicetree/bindings/power/st,stm32mp-pm-domain.yaml 
b/Documentation/devicetree/bindings/power/st,stm32mp-pm-domain.yaml
>>new file mode 100644
>>index 000000000000..4ab477fb4499
>>--- /dev/null
>>+++ b/Documentation/devicetree/bindings/power/st,stm32mp-pm-domain.yaml
>>@@ -0,0 +1,46 @@
>>+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>+%YAML 1.2
>>+---
>>+$id: http://devicetree.org/schemas/power/st,stm32mp-pm-domain.yaml#
>>+$schema: http://devicetree.org/meta-schemas/core.yaml#
>>+
>>+title: STM32MP generic power domain
>>+
>>+maintainers:
>>+-Patrick Delaunay <patrick.delaunay@foss.st.com>
>>+
>>+allOf:
>>+-$ref: /schemas/power/power-domain.yaml#
>>+
>>+description: |
>>+The STM32MP SoCs contain a D1 domain which defines the devices assigned to
>>+Cortex A cluster, the devices in this domain are functional only when this
>>+cluster is not in low power modes (Stop modes) with clock OFF.
>>+
>>+This PM domain node represents this dependency, based on PM framework and
>>+without wake-up path support.
>>+
>>+properties:
>>+compatible:
>>+const: st,stm32mp-pm-domain
>>+
>>+'#power-domain-cells':
>>+const: 0
>>+
>>+power-domains:
>>+maxItems: 1
>
>I don't get the purpose of this binding. There are no resources here, so
>this looks like fake intermediary (meaning: non-controllable). Why the 
devices cannot reference
>final domain?
Regarding the purpose of this domain, I agree that it does not control a 
power
switch or any other hardware resource. It is an intermediate genpd used to
represent a functional dependency. Devices attached to D1 need the 
Cortex-A35
cluster to remain in Run1, with their clocks available, regardless of 
whether
they are wakeup-capable. Wake-up events are handled by EXTI1.
This SoC power domain allows STM32MP to represent two paths in the 
power-domain
hierarchy for PSCI OSI:
one for device functionality (clock availability → cluster_pd) and
one for wake-up handling (EXTI → ret_pd).
Currently, GENPD_FLAG_ACTIVE_WAKEUP propagates wake-up requirements 
through the
Linux power-domain hierarchy used by PSCI CPU Idle. As a result, the cluster
domain cannot be powered off when an associated device has an active wakeup
source. Consequently, the PSCI cluster domain cannot enter the 
associated idle
state (Stop1).
In STM32MP SoCs, D1 domain is a hardware concept shared by PWR and RCC. 
In RCC,
kernel clocks are supplied to peripherals only when the associated CPU is
running: each device is assigned to a CPU through RIFSC and the IP blocks
associated with CPU1 = Cortex-A35 are not functional in low-power modes when
the associated CPU is stopped in low power mode.
When a node is present and enabled in the Linux device tree, its associated
device is always assigned to CPU1. If the device is not functional in 
low-power
modes (Stop1/2 and LP-Stop1/2), it is implicitly part of the D1 domain.
The added SoC power domain makes this relationship explicit, although 
this may
not be the best solution. If this intermediate domain is not the right 
way to
model the dependency, I would appreciate your guidance on an alternative.
>
>
>>+
>>+additionalProperties: false
>
>this goes after required block.
>
>>+
>>+required:
>>+-compatible
>>+-'#power-domain-cells'
>>+-power-domains
>>+
>>+examples:
>>+-|
>>+power-domain-d1 {
>
>Node names should be generic. See also an explanation and list of
>examples (not exhaustive) in DT specification:
>https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
>If you cannot find a name matching your device, please check in kernel
>sources for similar cases or you can grow the spec (via pull request to
>DT spec repo).
Sorry about that. I understood “power-domain” to be a generic node name, 
based
mainly on the pattern in /bindings/arm/psci.yaml and on node-name 
patterns such
as power-domain@[0-9a-f]+ used in the power bindings.
I now understand your point: power-domain-d1 is not a generic node name and
it is not a subnode of a power-controller, as described in
bindings/power/power-domain.yaml.
The PWR device, which manages the low-power modes and the power supplies 
for
each domain (including DVFS for the CPU and GPU), is handled by PSCI 
firmware.
I added an SoC power domain because I did not want to modify the PSCI 
binding
or driver; however, this may not be the best solution.
I also considered changing the PSCI domain handling to use a wakeup-source
property, but that would change the behavior of existing device trees.
In the driver drivers/cpuidle/cpuidle-psci-domain.c
static int psci_pd_init(struct device_node *np, bool use_osi)
{
...
/*
* Allow power off when OSI has been successfully enabled.
* PREEMPT_RT is not yet ready to enter domain idle states.
*/
if (use_osi && !IS_ENABLED(CONFIG_PREEMPT_RT)) {
pd->power_off = psci_pd_power_off;
-pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
+if (of_property_read_bool(np, "wakeup-source"))
+pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
} else {
pd->flags |= GENPD_FLAG_ALWAYS_ON;
}
....
The proposed STM32MP251 device tree becomes
-d1_pd: power-domain-d1 {
-compatible = "st,stm32mp-pm-domain";
-#power-domain-cells = <0>;
-power-domains = <&cluster_pd>;
-};
psci {
bootph-all;
compatible = "arm,psci-1.0";
method = "smc";
cpu0_pd: power-domain-cpu0 {
#power-domain-cells = <0>;
domain-idle-states = <&CPU_PWRDN>;
power-domains = <&cluster_pd>;
};
cluster_pd: power-domain-cluster {
#power-domain-cells = <0>;
domain-idle-states = <&STOP1>, <&LP_STOP1>;
power-domains = <&ret_pd>;
};
+d1_pd: power-domain-d1 {
+#power-domain-cells = <0>;
+power-domains = <&cluster_pd>;
+};
ret_pd: power-domain-retention {
#power-domain-cells = <0>;
domain-idle-states = <&LPLV_STOP1>;
+wakeup-source;
};
};
...
exti1: interrupt-controller@44220000 {
compatible = "st,stm32mp1-exti";
interrupt-controller;
#interrupt-cells = <2>;
power-domains = <&ret_pd>;
...
}
Moreover with this PSCI change, I could remove the need for the D1 domain:
-cluster_pd would not have a wakeup-source property, so the wake-up path 
would
not propagate.
-ret_pd would have a wakeup-source property, and EXTI1 would belong to this
domain.
psci {
bootph-all;
compatible = "arm,psci-1.0";
method = "smc";
cpu0_pd: power-domain-cpu0 {
#power-domain-cells = <0>;
domain-idle-states = <&CPU_PWRDN>;
power-domains = <&cluster_pd>;
};
cluster_pd: power-domain-cluster {
#power-domain-cells = <0>;
domain-idle-states = <&STOP1>, <&LP_STOP1>;
power-domains = <&ret_pd>;
};
ret_pd: power-domain-retention {
#power-domain-cells = <0>;
domain-idle-states = <&LPLV_STOP1>;
+wakeup-source;
};
};
>
>
>
>Best regards,
>Krzysztof
>
I add Ulf or Sudeep to the To: list to get feedback on the PSCI domain 
hierarchy,
particularly regarding backward compatibility.
For this proposal, I could also use a negated property ("no-wakeup-path' 
by exmaple)
to avoid breaking backward compatibility (property name to be confirmed,
perhaps need "arm," prefix).
If you think this is an acceptable proposal, I can submit a V2 of the 
series
using this approach:
in code:
-pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
+if (!of_property_read_bool(np, "no-wakeup-path"))
+pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
in STM32MP device tree:
cluster_pd: power-domain-cluster {
#power-domain-cells = <0>;
domain-idle-states = <&STOP1>, <&LP_STOP1>;
power-domains = <&ret_pd>;
+no-wakeup-path;
};
the cluster_pd domain can be powered-off even if on device is in the 
wake-up patch.
Regards
Patrick


  reply	other threads:[~2026-11-23 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 10:40 [RESEND PATCH 0/7] arm64: dts: st: add STM32MP2 power domains Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 1/7] dt-bindings: power: st: add STM32MP PM domain binding Patrick Delaunay
2026-11-23 11:11   ` Krzysztof Kozlowski
2026-11-23 17:53     ` Patrick DELAUNAY [this message]
2026-11-16 10:40 ` [RESEND PATCH 2/7] pmdomain: st: add STM32MP power domain Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 3/7] MAINTAINERS: add entry for ST STM32 power domain driver Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 4/7] arm64: dts: st: add D1 domain for STM32MP25 family Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 5/7] arm64: dts: st: fix power-domain labels DT coding style in STM32MP25 Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 6/7] arm64: dts: st: add D1 domain for STM32MP23 family Patrick Delaunay
2026-11-16 10:40 ` [RESEND PATCH 7/7] arm64: dts: st: add power domains for STM32MP21 family Patrick Delaunay

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=7493faea-092a-412b-8332-8fd68d20057e@foss.st.com \
    --to=patrick.delaunay@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=sudeep.holla@arm.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

all inboxes | Powered by JetHome®