From: Sudeep Holla <sudeep.holla@arm.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
Linux PM <linux-pm@vger.kernel.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Mark Rutland <mark.rutland@arm.com>,
Lina Iyer <ilina@codeaurora.org>,
Lukasz Luba <lukasz.luba@arm.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Stephen Boyd <sboyd@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Benjamin Gaignard <benjamin.gaignard@st.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] cpuidle: psci: Allow PM domain to be initialized even if no OSI mode
Date: Tue, 1 Sep 2020 15:11:41 +0100 [thread overview]
Message-ID: <20200901141141.GA11121@bogus> (raw)
In-Reply-To: <CAPDyKFrpfXD4tdghXyFPZUNT138FOi643rxTgrtjTBXP1S1nSg@mail.gmail.com>
On Tue, Sep 01, 2020 at 03:49:55PM +0200, Ulf Hansson wrote:
> On Tue, 1 Sep 2020 at 15:32, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Tue, Sep 01, 2020 at 02:12:26PM +0200, Ulf Hansson wrote:
> > > If the PSCI OSI mode isn't supported or fails to be enabled, the PM domain
> > > topology with the genpd providers isn't initialized. This is perfectly fine
> > > from cpuidle-psci point of view.
> > >
> > > However, since the PM domain topology in the DTS files is a description of
> > > the HW, no matter of whether the PSCI OSI mode is supported or not, other
> > > consumers besides the CPUs may rely on it.
> > >
> > > Therefore, let's always allow the initialization of the PM domain topology
> > > to succeed, independently of whether the PSCI OSI mode is supported.
> > > Consequentially we need to track if we succeed to enable the OSI mode, as
> > > to know when a domain idlestate can be selected.
> > >
> > > Note that, CPU devices are still not being attached to the PM domain
> > > topology, unless the PSCI OSI mode is supported.
> > >
> > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > > ---
> > >
> > > Changes in v2:
> > > - Assign the genpd ->power_off() callback, only when the PSCI OSI mode
> > > has been successfully enabled.
> > >
> > > ---
> > > drivers/cpuidle/cpuidle-psci-domain.c | 57 ++++++++++++++-------------
> > > 1 file changed, 29 insertions(+), 28 deletions(-)
> > >
> > > diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> > > index b6ab0415f450..256e7e35b5af 100644
> > > --- a/drivers/cpuidle/cpuidle-psci-domain.c
> > > +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> > > @@ -105,7 +105,7 @@ static void psci_pd_free_states(struct genpd_power_state *states,
> > > kfree(states);
> > > }
> > >
> > > -static int psci_pd_init(struct device_node *np)
> > > +static int psci_pd_init(struct device_node *np, bool use_osi)
> > > {
> > > struct generic_pm_domain *pd;
> > > struct psci_pd_provider *pd_provider;
> > > @@ -135,11 +135,14 @@ static int psci_pd_init(struct device_node *np)
> > >
> > > pd->free_states = psci_pd_free_states;
> > > pd->name = kbasename(pd->name);
> > > - pd->power_off = psci_pd_power_off;
> > > pd->states = states;
> > > pd->state_count = state_count;
> > > pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
> > >
> > > + /* Use the ->power_off() callback when OSI is enabled. */
> >
> > IIUC, you did mention that we need to attach PD even when the OSI fails
> > as this could be shared domain. With the below conditional assignment
> > of power_off, I understand that if OSI fails and we have domains attached,
> > then it will be always ON ?
>
> From a genpd point of view, the corresponding PM domain can be powered
> off (as long as all attached consumers allow that as well, of course).
>
Can be powered off ? Or will be powered off ? It sounds wrong if it will
be powered off as the domain needs to be powered up for CPU to be running.
It sounds like we may be out of sync though not a big issue, it sounds
weird for me.
> Hmm, maybe we should add a GENPD_FLAG_ALWAYS_ON, to really enforce
> that it stays on?
>
Should that not be default for CPU power domains if OSI can't be enabled ?
--
Regards,
Sudeep
next prev parent reply other threads:[~2020-09-01 14:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 12:12 [PATCH v2 0/2] cpuidle: psci: Always create the PM domains Ulf Hansson
2020-09-01 12:12 ` [PATCH v2 1/2] firmware: psci: Extend psci_set_osi_mode() to allow reset to PC mode Ulf Hansson
2020-09-01 13:30 ` Sudeep Holla
2020-09-01 12:12 ` [PATCH v2 2/2] cpuidle: psci: Allow PM domain to be initialized even if no OSI mode Ulf Hansson
2020-09-01 13:32 ` Sudeep Holla
2020-09-01 13:49 ` Ulf Hansson
2020-09-01 14:11 ` Sudeep Holla [this message]
2020-09-01 14:23 ` 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=20200901141141.GA11121@bogus \
--to=sudeep.holla@arm.com \
--cc=Lorenzo.Pieralisi@arm.com \
--cc=benjamin.gaignard@st.com \
--cc=bjorn.andersson@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=ilina@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=mark.rutland@arm.com \
--cc=rjw@rjwysocki.net \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vincent.guittot@linaro.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;
as well as URLs for NNTP newsgroup(s).