public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Lets not expect domains marked as `RPM_ALWAYS_ON`/`ALWAYS_ON` to be ON at boot
@ 2023-12-01  6:05 Ajay Agarwal
  2023-12-01 12:12 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Ajay Agarwal @ 2023-12-01  6:05 UTC (permalink / raw)
  To: Rafael J. Wysocki, Kevin Hilman, Ulf Hansson, Pavel Machek,
	Len Brown, Leonard Crestez
  Cc: linux-pm, manugautam, mshavit, quangh, vamshigajjela

Hello Linux PM experts

For a given power domain, if the `genpd->flags` has the GENPD_FLAG_RPM_ALWAYS_ON
flag set, then pm_genpd_init expects that domain to be ON:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/power/domain.c?h=v6.7-rc3#n2102

I have a usecase where the power domain is not ON by default on kernel boot,
but I also want it to stay ON during RPM. But the current logic fails the
`pm_genpd_init` for me.

IMO, the kernel should not force a PD which needs to stay ON during RPM to be ON
at boot also. It is quite possible that the PD will be turned ON for the very
first time by a client driver in the kernel itself.

Additionally, I think the kernel as well should not enforce this for PDs which 
do not want to turn OFF ever, i.e., the ones which have `GENPD_FLAG_ALWAYS_ON`
flag set. Let the kernel turn ON these PDs when it wants and only then prevent
the RPM or system suspend from turning these domains OFF.

Proposed patch in pm_genpd_init:
```
-       /* Always-on domains must be powered on at initialization. */
-       if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
-                       !genpd_status_on(genpd)) {
-               pr_err("always-on PM domain %s is not on\n", genpd->name);
-               return -EINVAL;
-       }
-
```

Looking for your views here.

Thanks
Ajay

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

end of thread, other threads:[~2023-12-01 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01  6:05 Lets not expect domains marked as `RPM_ALWAYS_ON`/`ALWAYS_ON` to be ON at boot Ajay Agarwal
2023-12-01 12:12 ` Ulf Hansson

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