Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/3] pmdomain: Support system-suspend-only domain idle states
@ 2026-11-13  4:55 Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 1/3] dt-bindings: power: domain-idle-state: Add system-state Maulik Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maulik Shah @ 2026-11-13  4:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ulf Hansson,
	Rafael J. Wysocki, Bjorn Andersson, Konrad Dybcio, Abel Vesa,
	Daniel Lezcano
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-msm, Maulik Shah,
	Kevin Hilman

To achieve the deepest CPUSS low power state, which can lead to chip
rail power collapse (CxPC) on SoCs such as Lemans, Monaco and Nord, the CPU
subsystem (CPUSS) and the Safety Island (SAIL) subsystem must be powered
down together in a coordinated sequence. The Safety Island (SAIL) is a
dedicated subsystem responsible for safety-critical monitoring and control
functions, and can operate independently from the main CPU subsystem.

This transition is divided into two stages. First, firmware requests SAIL
power-down through IPC, after which SAIL waits for hardware low power
handshakes from CPUSS. If an interrupt or another condition aborts CPUSS
entry into the deepest low power mode after the IPC request, firmware must
bring SAIL back out of its low power sequence before any CPU can resume
execution in the OS. This recovery can take a second or more.

Selecting this state during opportunistic CPU idle can therefore cause
substantial wakeup delays and repeatedly interrupt SAIL operation whenever
the CPUs become idle. SAIL must remain operational during normal system
activity, so this coordinated power-down state should be reserved for
system-wide suspend such as suspend-to-idle. Shallower domain states
remain available for regular CPU and cluster idle power management.

This restriction concerns when SAIL may stop its work, in addition to the
transition latency. Idle-state latency and residency values alone do not
express that requirement. System suspend does not eliminate interrupts or
aborted entry, but provides the context in which coordinated SAIL
power-down is appropriate.

All domain idle states described in devicetree are currently considered
during the regular idle path. This limits which states can be described in
devicetree. Due to hardware constraints, some domain idle states are only
applicable to system-wide suspend, including suspend-to-idle (s2idle).

To allow these states to be described in DT and used only during system
suspend, this series adds a boolean system-state property to domain idle
state bindings and a corresponding system_state boolean in genpd. The
genpd governors skip these states during normal operation. The system
suspend selection path remains unchanged, allowing these states during
suspend while retaining the existing wakeup latency checks for s2idle.

This series applies to cluster idle states with the "domain-idle-state"
compatible string managed by genpd and its governors, but can be extended
to CPU idle states with the "arm,idle-state" compatible string if the same
restriction is needed for CPUidle states too.

Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
Changes in v2:
- Explain why the state is limited to the four-PMIC Monaco EVK and is
  not supported on the two-PMIC Monaco AC EVK.
- Push binding example and DT latencie/residency to the realistic values
- Use lowercase hex for the PSCI suspend parameter.
- Link to v1: https://patch.msgid.link/20261005-s2idle_state-v1-0-3c402c66f388@oss.qualcomm.com

To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Ulf Hansson <ulfh@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org

---
Maulik Shah (3):
      dt-bindings: power: domain-idle-state: Add system-state
      pmdomain: Add support for system-suspend-only states
      arm64: dts: qcom: monaco-evk: Add suspend-only power collapse state

 .../devicetree/bindings/power/domain-idle-state.yaml    | 14 ++++++++++++++
 arch/arm64/boot/dts/qcom/monaco-evk.dts                 | 17 +++++++++++++++++
 drivers/pmdomain/core.c                                 |  2 ++
 drivers/pmdomain/governor.c                             |  6 ++++++
 include/linux/pm_domain.h                               |  1 +
 5 files changed, 40 insertions(+)
---
base-commit: aaa2f954c21b205a0bcd0961e5b2be4e82e58455
change-id: 20261001-s2idle_state-6484bbbf48fb

Best regards,
--  
Maulik Shah <maulik.shah@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] dt-bindings: power: domain-idle-state: Add system-state
  2026-11-13  4:55 [PATCH v2 0/3] pmdomain: Support system-suspend-only domain idle states Maulik Shah
@ 2026-11-13  4:55 ` Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 3/3] arm64: dts: qcom: monaco-evk: Add suspend-only power collapse state Maulik Shah
  2 siblings, 0 replies; 5+ messages in thread
From: Maulik Shah @ 2026-11-13  4:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ulf Hansson,
	Rafael J. Wysocki, Bjorn Andersson, Konrad Dybcio, Abel Vesa,
	Daniel Lezcano
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-msm, Maulik Shah,
	Kevin Hilman

Some domain idle states require system-wide coordination and are not
applicable while the platform is up and running.

Add a boolean system-state property to describe these states.

Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
 .../devicetree/bindings/power/domain-idle-state.yaml       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/domain-idle-state.yaml b/Documentation/devicetree/bindings/power/domain-idle-state.yaml
index 4dd4f59bbbec..b19952f6225d 100644
--- a/Documentation/devicetree/bindings/power/domain-idle-state.yaml
+++ b/Documentation/devicetree/bindings/power/domain-idle-state.yaml
@@ -45,6 +45,12 @@ patternProperties:
           state will yield power benefits, after overcoming the overhead while
           entering the idle state.
 
+      system-state:
+        description:
+          When present, this state requires system-wide coordination and is
+          not applicable while the platform is up and running.
+        type: boolean
+
       arm,psci-suspend-param:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: |
@@ -77,5 +83,13 @@ examples:
         exit-latency-us = <40>;
         min-residency-us = <80>;
       };
+
+      domain_power_off: domain-power-off {
+        compatible = "domain-idle-state";
+        entry-latency-us = <706562>;
+        exit-latency-us = <706562>;
+        min-residency-us = <1414124>;
+        system-state;
+      };
     };
 ...

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states
  2026-11-13  4:55 [PATCH v2 0/3] pmdomain: Support system-suspend-only domain idle states Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 1/3] dt-bindings: power: domain-idle-state: Add system-state Maulik Shah
@ 2026-11-13  4:55 ` Maulik Shah
  2026-11-13  5:21   ` sashiko-bot
  2026-11-13  4:55 ` [PATCH v2 3/3] arm64: dts: qcom: monaco-evk: Add suspend-only power collapse state Maulik Shah
  2 siblings, 1 reply; 5+ messages in thread
From: Maulik Shah @ 2026-11-13  4:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ulf Hansson,
	Rafael J. Wysocki, Bjorn Andersson, Konrad Dybcio, Abel Vesa,
	Daniel Lezcano
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-msm, Maulik Shah,
	Kevin Hilman

Some domain idle states require system-wide coordination and should not be
selected during regular CPU idle. However those states remain valid for
system-wide suspend like s2idle.

Add a per-state system_state boolean and populate it from the system-state
property. Make the genpd governor skip these states during CPU idle. Leave
the system wide suspend path unchanged so s2idle can select them.

Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
 drivers/pmdomain/core.c     | 2 ++
 drivers/pmdomain/governor.c | 6 ++++++
 include/linux/pm_domain.h   | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 964e44c2f78f..288c0deb2340 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -3701,6 +3701,8 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state,
 	if (!err)
 		genpd_state->residency_ns = 1000LL * residency;
 
+	genpd_state->system_state = of_property_read_bool(state_node, "system-state");
+
 	err = of_property_read_string(state_node, "idle-state-name",
 				      &genpd_state->name);
 	if (err)
diff --git a/drivers/pmdomain/governor.c b/drivers/pmdomain/governor.c
index 38bba24ec26e..7684f9eecf85 100644
--- a/drivers/pmdomain/governor.c
+++ b/drivers/pmdomain/governor.c
@@ -185,6 +185,9 @@ static bool __default_power_down_ok(struct dev_pm_domain *pd,
 	s64 min_off_time_ns;
 	s64 off_on_time_ns;
 
+	if (genpd->states[state].system_state)
+		return false;
+
 	off_on_time_ns = genpd->states[state].power_off_latency_ns +
 		genpd->states[state].power_on_latency_ns;
 
@@ -407,6 +410,9 @@ static bool cpu_power_down_ok(struct dev_pm_domain *pd)
 	 */
 	i = genpd->state_idx;
 	do {
+		if (genpd->states[i].system_state)
+			continue;
+
 		if ((idle_duration_ns >= (genpd->states[i].residency_ns +
 		    genpd->states[i].power_off_latency_ns)) &&
 		    (global_constraint >= (genpd->states[i].power_on_latency_ns +
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 14e0e346c610..d9b3e67042e5 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -188,6 +188,7 @@ struct genpd_power_state {
 	s64 power_off_latency_ns;
 	s64 power_on_latency_ns;
 	s64 residency_ns;
+	bool system_state;
 	u64 usage;
 	u64 rejected;
 	u64 above;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] arm64: dts: qcom: monaco-evk: Add suspend-only power collapse state
  2026-11-13  4:55 [PATCH v2 0/3] pmdomain: Support system-suspend-only domain idle states Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 1/3] dt-bindings: power: domain-idle-state: Add system-state Maulik Shah
  2026-11-13  4:55 ` [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states Maulik Shah
@ 2026-11-13  4:55 ` Maulik Shah
  2 siblings, 0 replies; 5+ messages in thread
From: Maulik Shah @ 2026-11-13  4:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Ulf Hansson,
	Rafael J. Wysocki, Bjorn Andersson, Konrad Dybcio, Abel Vesa,
	Daniel Lezcano
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-msm, Maulik Shah,
	Kevin Hilman

To achieve SoC low power mode like chip rail power collapse (CxPC),
the Monaco EVK board with four PMICs requires coordinated power-down of
CPUSS and the Safety Island (SAIL) subsystem. This deepest system power
collapse state is reserved for system-wide suspend (s2idle).

Only the Monaco EVK with four PMICs supports this deepest state. The
Monaco AC EVK described by monaco-ac-evk.dts has two PMICs and does not
support powering down SAIL. Define the state in monaco-evk.dts instead
of the shared monaco.dtsi so it is only available on the supported
board.

Add the system_suspend domain idle state, mark it with system-state,
and reference it from the system power domain.

Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/monaco-evk.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/monaco-evk.dts b/arch/arm64/boot/dts/qcom/monaco-evk.dts
index 539c9c80a808..5e6206bcc97f 100644
--- a/arch/arm64/boot/dts/qcom/monaco-evk.dts
+++ b/arch/arm64/boot/dts/qcom/monaco-evk.dts
@@ -80,6 +80,19 @@ m2_e_uart_ep: endpoint@0 {
 		};
 	};
 
+	cpus {
+		domain-idle-states {
+			system_suspend: domain-suspend {
+				compatible = "domain-idle-state";
+				arm,psci-suspend-param = <0x4200c344>;
+				entry-latency-us = <706562>;
+				exit-latency-us = <706562>;
+				min-residency-us = <1414124>;
+				system-state;
+			};
+		};
+	};
+
 	dmic: audio-codec-0 {
 		compatible = "dmic-codec";
 		#sound-dai-cells = <0>;
@@ -772,6 +785,10 @@ tpm@0 {
 	};
 };
 
+&system_pd {
+	domain-idle-states = <&system_sleep>, <&system_suspend>;
+};
+
 &tlmm {
 	pcie0_default_state: pcie0-default-state {
 		wake-pins {

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states
  2026-11-13  4:55 ` [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states Maulik Shah
@ 2026-11-13  5:21   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-13  5:21 UTC (permalink / raw)
  To: Maulik Shah; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] pmdomain: unfiltered system_state in
  genpd_reflect_residency()
--

commit 1997c1201917b38c7d4bd3614225f7a62b53a68b
Author: Maulik Shah <maulik.shah@oss.qualcomm.com>

pmdomain: Add support for system-suspend-only states

This commit adds a system_state boolean to struct genpd_power_state,
populated from the "system-state" DT property, so the genpd governor skips
system-suspend-only states during regular CPU and runtime idle while
keeping them selectable during system-wide suspend.

> diff --git a/drivers/pmdomain/governor.c b/drivers/pmdomain/governor.c
> index 38bba24ec26e3..7684f9eecf853 100644
> --- a/drivers/pmdomain/governor.c
> +++ b/drivers/pmdomain/governor.c

[ ... ]

> @@ -407,6 +410,9 @@ static bool cpu_power_down_ok(struct dev_pm_domain *pd)
>  	 */
>  	i = genpd->state_idx;
>  	do {
> +		if (genpd->states[i].system_state)
> +			continue;
> +
>  		if ((idle_duration_ns >= (genpd->states[i].residency_ns +
>  		    genpd->states[i].power_off_latency_ns)) &&
>  		    (global_constraint >= (genpd->states[i].power_on_latency_ns +

[Severity: Medium]
Should genpd_reflect_residency() also skip next_state when
next_state->system_state is set?

When cpu_power_down_ok() skips a system_state idle state and selects a
shallower state, it sets genpd->gd->reflect_residency = true.  On wakeup,
genpd_power_on() calls genpd_reflect_residency(), which checks the next
deeper state unconditionally:

drivers/pmdomain/core.c:genpd_reflect_residency() {
    ...
	} else if (state_idx < (genpd->state_count -1)) {
		next_state = &genpd->states[state_idx + 1];
		target_ns = next_state->power_off_latency_ns +
			next_state->residency_ns;

		if (sleep_ns >= target_ns)
			state->below++;
	}
    ...
}

If genpd->states[state_idx + 1] has system_state set, it is not eligible
for regular CPU idle, yet any CPU idle sleep reaching its target_ns will
falsely increment state->below in the debugfs idle_states statistics.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-s2idle_state-v2-0-ad604182e7e7@oss.qualcomm.com?part=2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-13  5:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  4:55 [PATCH v2 0/3] pmdomain: Support system-suspend-only domain idle states Maulik Shah
2026-11-13  4:55 ` [PATCH v2 1/3] dt-bindings: power: domain-idle-state: Add system-state Maulik Shah
2026-11-13  4:55 ` [PATCH v2 2/3] pmdomain: Add support for system-suspend-only states Maulik Shah
2026-11-13  5:21   ` sashiko-bot
2026-11-13  4:55 ` [PATCH v2 3/3] arm64: dts: qcom: monaco-evk: Add suspend-only power collapse state Maulik Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox