Re: [PATCH 2/7] pmdomain: st: add STM32MP power domain
From: Ulf Hansson
Date: Wed Nov 25 2026 - 07:36:04 EST
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.
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().
[...]
Kind regards
Uffe