All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajay Agarwal <ajayagarwal@google.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>, Pavel Machek <pavel@ucw.cz>,
	Len Brown <len.brown@intel.com>,
	Leonard Crestez <leonard.crestez@nxp.com>
Cc: linux-pm@vger.kernel.org, manugautam@google.com,
	mshavit@google.com, quangh@google.com, vamshigajjela@google.com
Subject: Lets not expect domains marked as `RPM_ALWAYS_ON`/`ALWAYS_ON` to be ON at boot
Date: Fri, 1 Dec 2023 11:35:57 +0530	[thread overview]
Message-ID: <ZWl3xd7lc5pnnIcz@google.com> (raw)

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

             reply	other threads:[~2023-12-01  6:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  6:05 Ajay Agarwal [this message]
2023-12-01 12:12 ` Lets not expect domains marked as `RPM_ALWAYS_ON`/`ALWAYS_ON` to be ON at boot 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=ZWl3xd7lc5pnnIcz@google.com \
    --to=ajayagarwal@google.com \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=manugautam@google.com \
    --cc=mshavit@google.com \
    --cc=pavel@ucw.cz \
    --cc=quangh@google.com \
    --cc=rafael@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vamshigajjela@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.