public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuidle: psci: Activate GENPD_FLAG_ACTIVE_WAKEUP with OSI
@ 2024-11-19 13:18 Patrick Delaunay
  2024-12-10 14:01 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Delaunay @ 2024-11-19 13:18 UTC (permalink / raw)
  To: Alexandre TORGUE, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano
  Cc: Patrick Delaunay, linux-arm-kernel, linux-kernel, linux-pm

Set GENPD_FLAG_ACTIVE_WAKEUP flag for domain psci cpuidle when OSI
is activated, then when a device is set as the wake-up source using
device_set_wakeup_path, the PSCI power domain could be retained to allow
so that the associated device can wake up the system.

With this flag, for S2IDLE system-wide suspend, the wake-up path is
managed in each device driver and is tested in the power framework:
a PSCI domain is only turned off when GENPD_FLAG_ACTIVE_WAKEUP is enabled
and the associated device is not in the wake-up path, so PSCI CPUIdle
selects the lowest level in the PSCI topology according to the wake-up
path.

This patch is a preliminary step to support PSCI OSI on the STM32MP25
platform with the D1 domain (power-domain-cluster) for the A35 cortex
cluster and for the associated peripherals including EXTI1 which manages
the wake-up interrupts for domain D1.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 drivers/cpuidle/cpuidle-psci-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index 146f97068022..5fb5228f6bf1 100644
--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -72,6 +72,7 @@ static int psci_pd_init(struct device_node *np, bool use_osi)
 	 */
 	if (use_osi) {
 		pd->power_off = psci_pd_power_off;
+		pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
 		if (IS_ENABLED(CONFIG_PREEMPT_RT))
 			pd->flags |= GENPD_FLAG_RPM_ALWAYS_ON;
 	} else {
-- 
2.25.1


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

* Re: [PATCH] cpuidle: psci: Activate GENPD_FLAG_ACTIVE_WAKEUP with OSI
  2024-11-19 13:18 [PATCH] cpuidle: psci: Activate GENPD_FLAG_ACTIVE_WAKEUP with OSI Patrick Delaunay
@ 2024-12-10 14:01 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2024-12-10 14:01 UTC (permalink / raw)
  To: Patrick Delaunay
  Cc: Alexandre TORGUE, Rafael J. Wysocki, Daniel Lezcano,
	linux-arm-kernel, linux-kernel, linux-pm

On Tue, 19 Nov 2024 at 14:21, Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> Set GENPD_FLAG_ACTIVE_WAKEUP flag for domain psci cpuidle when OSI
> is activated, then when a device is set as the wake-up source using
> device_set_wakeup_path, the PSCI power domain could be retained to allow
> so that the associated device can wake up the system.
>
> With this flag, for S2IDLE system-wide suspend, the wake-up path is
> managed in each device driver and is tested in the power framework:
> a PSCI domain is only turned off when GENPD_FLAG_ACTIVE_WAKEUP is enabled
> and the associated device is not in the wake-up path, so PSCI CPUIdle
> selects the lowest level in the PSCI topology according to the wake-up
> path.
>
> This patch is a preliminary step to support PSCI OSI on the STM32MP25
> platform with the D1 domain (power-domain-cluster) for the A35 cortex
> cluster and for the associated peripherals including EXTI1 which manages
> the wake-up interrupts for domain D1.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Makes perfect sense to me - so applied for next, thanks!

Kind regards
Uffe


> ---
>
>  drivers/cpuidle/cpuidle-psci-domain.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> index 146f97068022..5fb5228f6bf1 100644
> --- a/drivers/cpuidle/cpuidle-psci-domain.c
> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> @@ -72,6 +72,7 @@ static int psci_pd_init(struct device_node *np, bool use_osi)
>          */
>         if (use_osi) {
>                 pd->power_off = psci_pd_power_off;
> +               pd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
>                 if (IS_ENABLED(CONFIG_PREEMPT_RT))
>                         pd->flags |= GENPD_FLAG_RPM_ALWAYS_ON;
>         } else {
> --
> 2.25.1
>

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

end of thread, other threads:[~2024-12-10 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 13:18 [PATCH] cpuidle: psci: Activate GENPD_FLAG_ACTIVE_WAKEUP with OSI Patrick Delaunay
2024-12-10 14:01 ` Ulf Hansson

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