mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
To: Ulf Hansson <ulf.hansson@oss.qualcomm.com>
Cc: Antonio Borneo <antonio.borneo@foss.st.com>,
	Ulf Hansson <ulfh@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	Linux STM32 <linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 2/7] pmdomain: st: add STM32MP power domain
Date: Thu, 26 Nov 2026 11:40:28 +0100	[thread overview]
Message-ID: <47a78147-8504-4186-8e68-2d20d3832541@foss.st.com> (raw)
In-Reply-To: <CAPx+jO8d58tCoEL52baYMzjJ9VzyfpVNhruKAhrHrnEwuOoJig@mail.gmail.com>

Hi,

On 11/25/26 13:35, Ulf Hansson wrote:
> On Mon, Nov 16, 2026 at 4:11 PM Patrick DELAUNAY
> <patrick.delaunay@foss.st.com> wrote:
>> Hi,
>>
>> On 11/14/26 11:40, Ulf Hansson wrote:
>>> On Wed, Nov 4, 2026 at 3:02 PM Patrick Delaunay
>>> <patrick.delaunay@foss.st.com> 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@foss.st.com/


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;
};


>
> 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

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.


>
> [...]
>
> Kind regards
> Uffe


Regard

Patrick


  reply	other threads:[~2026-11-26 10:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 13:55 [PATCH 0/7] arm64: dts: st: add STM32MP2 power domains Patrick Delaunay
2026-11-04 13:55 ` [PATCH 1/7] dt-bindings: power: st: add STM32MP PM domain binding Patrick Delaunay
2026-11-04 13:55 ` [PATCH 2/7] pmdomain: st: add STM32MP power domain Patrick Delaunay
2026-11-14 10:40   ` Ulf Hansson
2026-11-16 15:10     ` Patrick DELAUNAY
2026-11-25 12:35       ` Ulf Hansson
2026-11-26 10:40         ` Patrick DELAUNAY [this message]
2026-11-26 11:20           ` Ulf Hansson
2026-11-04 13:55 ` [PATCH 3/7] MAINTAINERS: add entry for ST STM32 power domain driver Patrick Delaunay
2026-11-04 16:41   ` Patrick Delaunay
2026-11-04 13:55 ` [PATCH 4/7] arm64: dts: st: add D1 domain for STM32MP25 family Patrick Delaunay
2026-11-04 13:55 ` [PATCH 5/7] arm64: dts: st: fix power-domain labels DT coding style in STM32MP25 Patrick Delaunay
2026-11-04 13:55 ` [PATCH 6/7] arm64: dts: st: add D1 domain for STM32MP23 family Patrick Delaunay
2026-11-04 13:55 ` [PATCH 7/7] arm64: dts: st: add power domains for STM32MP21 family Patrick Delaunay
2026-11-14 10:34 ` [PATCH 0/7] arm64: dts: st: add STM32MP2 power domains Ulf Hansson

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=47a78147-8504-4186-8e68-2d20d3832541@foss.st.com \
    --to=patrick.delaunay@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=antonio.borneo@foss.st.com \
    --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=ulf.hansson@oss.qualcomm.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®