Re: [PATCH 2/7] pmdomain: st: add STM32MP power domain
From: Ulf Hansson
Date: Thu Nov 26 2026 - 06:20:38 EST
On Thu, Nov 26, 2026 at 11:41 AM Patrick DELAUNAY
<patrick.delaunay@xxxxxxxxxxx> wrote:
>
> Hi,
>
> On 11/25/26 13:35, Ulf Hansson wrote:
> > On Mon, Nov 16, 2026 at 4:11 PM Patrick DELAUNAY
> > <patrick.delaunay@xxxxxxxxxxx> wrote:
> >> Hi,
> >>
> >> On 11/14/26 11:40, Ulf Hansson wrote:
> >>> On Wed, Nov 4, 2026 at 3:02 PM Patrick Delaunay
> >>> <patrick.delaunay@xxxxxxxxxxx> wrote:
> >>>> Add a generic PM domain for the STM32MP D1 domain, using the PM
> >>>> framework to manage attached devices.
> >>>>
> >>>> Make D1 a subdomain of the PSCI cluster domain, so active devices keep
> >>>> the Cortex-A35 cluster in Run1. Do not set GENPD_FLAG_ACTIVE_WAKEUP on
> >>>> D1: system wakeups are handled by EXTI1 through the RET_PD PSCI domain.
> >>> Would you mind elaborating on the system wakeups a bit more?
> >>>
> >>> The devices that get attached to the D1 PM domain do they have another
> >>> PM domain as well, to support the system wakeups?
> >>
> >> Each device in D1 domain use
> >>
> >> - D1 domain to allow any low power mode (Stop1) when they are suspended
> >>
> >> - EXTI1 interruption to manage wake-up patch
> >>
> >> For example for UART:
> >>
> >> usart2: serial@400e0000 {
> >> compatible = "st,stm32h7-uart";
> >> reg = <0x400e0000 0x400>;
> >> - interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
> >> + interrupts-extended = <&exti1 27 IRQ_TYPE_LEVEL_HIGH>;
> >> ...
> >> power-domains = <&d1_pd>;
> >> + wakeup-source;
> >>
> >> status = "disabled";
> >> };
> >>
> >>
> >> Then the system wake up for S2Idle is managed by EXTI1 device wake-up state
> >>
> >> when interruptions are activated.
> >>
> >>
> >> Moreover LPLV-Stop1 is not allowed when EXTI is "active" for OSI, i.e
> >> when at least
> >>
> >> one interruption of Group2 activated.
> >>
> >>
> >> To explain deeper, when OSI is fully activated [1], i.e with full
> >> upstream for STM32MP25
> >>
> >>
> >> - the PSCI power domain Cluster Domain allows "Stop1" and "LP-Stop1" low
> >> power mode as CpuIdle mode
> >>
> >> - D1 is part of Cluster => the device is D1 domain allow low power
> >> mode when they are suspended
> >>
> >> => active Wake-Up for device
> >> in D1 domain device is compatible with Stop1/LP-Stop1
> >> the wake-up path is NOT
> >> propagated to parent domain
> >>
> >>
> >> - the PSCI Retention Domain allows "LPLV-Stop1"
> >>
> >> EXTI is part of this domain (not yet upstreamed) [2] :
> >>
> >>
> >> exti1: interrupt-controller@44220000 {
> >> compatible = "st,stm32mp1-exti";
> >> interrupt-controller;
> >> #interrupt-cells = <2>;
> >> + power-domains = <&ret_pd>;
> >> ....
> >>
> >> }
> >>
> >> the Group2 wake up sources are handled by EXTI1 and but they are not
> >> functional when the LPLV mode is performed.
> >>
> >> We handled this restriction by EXTI patches no yet upstreamed [3]
> >>
> >> - activating the wake-up path in EXTI1 device when at least one
> >> interruption of group2 is activated for S2DIle mode
> >>
> >> - with EXTI1 pm_runtime state for OSI mode
> >>
> >>
> >> So the "ret_pd" domain can't be deactivated when EXTI1 interrupts are
> >> activated for runtime (OSI) or
> >>
> >> part of the wake-up patch for S2IDLE
> >>
> >>
> >> [1]
> >> https://wiki.st.com/stm32mpu/wiki/Power_overview#STM32MP2_series_power_domains
> >>
> >>
> >> [2]
> >> https://github.com/STMicroelectronics/linux/blob/v6.18-stm32mp/arch/arm64/boot/dts/st/stm32mp251.dtsi
> >>
> >> https://github.com/STMicroelectronics/linux/commit/d216f8439d14e0a11475495cf5445e05cc4a9da9
> >>
> >>
> >> [3]
> >> https://github.com/STMicroelectronics/linux/blob/v6.18-stm32mp/drivers/irqchip/irq-stm32mp-exti.c
> >>
> >> irqchip: stm32mp-exti: Add support of pm runtime
> >>
> >> https://github.com/STMicroelectronics/linux/commit/4a4a20f5c5aae461a7a14c98efeddbc9cd08c672
> >>
> >> irqchip: stm32mp-exti: Add support of wake-up path for S2Idle
> >>
> >> https://github.com/STMicroelectronics/linux/commit/1d3b854e7b95318b67afd2dc16b8ff5fc060443a
> >>
> >>
> >>> Just trying to make sure this gets modeled correctly.
> >>
> >> I hope that follow the genPD model...
> >>
> >> and if it is the case , do you need update in the commit message to
> >> clarify it ?
> > Okay, thanks for sharing and elaborating. Even if it's not entirely
> > straightforward to me, it looks fine to me, to model the HW like this.
> > Although, in the end you need to convince DT maintainers to accept the
> > updated bindings.
>
>
> they are not yet convince....
>
> But after Krzysztof review,
>
> I propose a other solution to handle the needed domain without wakeup
> support directly in PSCI topology
>
> see detail in:
>
> https://patchwork.kernel.org/project/linux-arm-kernel/patch/20261116114024.RESEND.1.If3d55e03486413ca40ac73f9bf07046e76a00f0a@changeid/
>
> https://lore.kernel.org/all/7493faea-092a-412b-8332-8fd68d20057e@xxxxxxxxxxx/
>
>
> I hope that this modification in PSCI domain (code and binding) is
> acceptable for you.
>
> to summarize
>
> in code:
> - pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
> + if (!of_property_read_bool(np, "arm,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>;
> + arm,no-wakeup-path;
> };
>
Let's first see if the functional dependency PM domain can be modelled
as you already suggested in the $subject series.
>
> >
> > However, there is a fallback option as well. I think it should be
> > possible to drop the D1 PM domain altogether and instead hook up
> > "usart2" (and similar devices) directly to the cluster PM domain. To
> > allow deeper states for the cluster PM domain even if there is a
> > system wakeup configured for the usart2 device, the corresponding
> > driver can call device_set_out_band_wakeup(). This informs genpd that
> > it's perfectly fine to do a power off during system suspend, see also
> > genpd_finish_suspend().
>
>
> If the device are move in cluster power domain, it is OK for S2Idle but
> it is not valid for CpuIdle
>
> For example when UART/SDCARD is not suspended, the domain cluster will
> be powerered-off
No it will not. If UART is active from a runtime PM point of view,
that will prevent the cluster from being turned off.
>
> with CpuIdle and with pm runtime even witthout S2Idle system suspend
>
> when sleep time > latency of idle state
>
>
> So Stop1/LP-Stop1 can be dynamically request when device are still
> active, even if device are
>
> not functional in this low-power mode.
Sorry, I can't follow what you are typing. Please work a bit on your
terminology and how you format the text.
[...]
Kind regards
Uffe