Re: [RFC PATCH 3/3] cpuidle: psci: Initialize the PM domains in powered off state for OSI
From: Abel Vesa
Date: Thu Aug 20 2026 - 23:25:04 EST
On 26-08-19 17:14:53, Ulf Hansson wrote:
> From: Ulf Hansson <ulfh@xxxxxxxxxx>
>
> At the point when the PM domain and the topology are registered through the
> genpd subsystem, it's not really known whether corresponding CPUs are
> online and thus if the PM domain should be initialized as powered on or
> not. Instead this information becomes available when the CPU devices gets
> attached to their respective PM domain through dt_idle_attach_cpu().
>
> This is a problem when using PSCI OS-initiated mode, as we may end up with
> a PM domain that has the genpd's status indicating it to be powered on,
> while it in fact may not be the case. In the less severe scenario, this
> leads to selecting a shallower domain idle state for the PM domain than
> necessary. A more critical problem is when a non-CPU device shares the PM
> domain, leading to their corresponding drivers not being able to trust the
> status of it.
Exactly why a third state like GENPD_STATE_UNKNOWN would be more
fitting, IMO. Maybe something we can do at some point.
This solution works for now as well.
>
> Let's fix these problems by initializing the state for the genpd's to be
> powered off and in the deepest possible domain idle state, when using
> OS-initiated mode. The support for ->sync_state() is maintained by setting
> the GENPD_FLAG_OFF_STAY_ON for the genpds in question.
>
> Reported-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
> Link: https://lore.kernel.org/all/20260811-domain_off_ss3-v1-0-6a0a0fc023f5@xxxxxxxxxxxxxxxx/
> Signed-off-by: Ulf Hansson <ulfh@xxxxxxxxxx>
Reviewed-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>