linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	Saravana Kannan <saravanak@google.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Lina Iyer <ilina@codeaurora.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Benjamin Gaignard <benjamin.gaignard@st.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 0/5] cpuidle: psci: Various improvements for PSCI PM domains
Date: Tue, 7 Jul 2020 14:51:55 +0200	[thread overview]
Message-ID: <CAPDyKFpc+LKZ8Khjau9iLD0YJTHvqav2HD4+aDhMaPpSEXPawA@mail.gmail.com> (raw)
In-Reply-To: <cf424e19-de17-8fa8-f2a3-9e8f996fa7ad@arm.com>

On Tue, 7 Jul 2020 at 14:37, Lukasz Luba <lukasz.luba@arm.com> wrote:
>
>
>
> On 7/7/20 12:53 PM, Ulf Hansson wrote:
> > Hi Lukaz,
> >
> > On Tue, 30 Jun 2020 at 12:23, Lukasz Luba <lukasz.luba@arm.com> wrote:
> >>
> >> Hi Ulf,
> >>
> >> On 6/15/20 4:20 PM, Ulf Hansson wrote:
> >>> The main change in this series is done in patch 5/5, which implements support
> >>> to prevent domain idlestates until all PSCI PM domain consumers are ready for
> >>> it. To reach that point the corresponding code for cpuidle-psci and
> >>> cpuidle-psci-domain, needed to be converted into platform drivers, which is
> >>> done by the earlier changes in the series.
> >>>
> >>> Additionally, some improvements have been made to the error path, which becomes
> >>> easier when the code gets converted to platform drivers.
> >>>
> >>> Deployment for a Qcom SoC, which actually takes full benefit of these changes
> >>> are also in the pipe, but deferring then a bit until $subject series have been
> >>> discussed.
> >>>
> >>> Kind regards
> >>> Ulf Hansson
> >>>
> >>> Ulf Hansson (5):
> >>>     cpuidle: psci: Fail cpuidle registration if set OSI mode failed
> >>>     cpuidle: psci: Fix error path via converting to a platform driver
> >>>     cpuidle: psci: Split into two separate build objects
> >>>     cpuidle: psci: Convert PM domain to platform driver
> >>>     cpuidle: psci: Prevent domain idlestates until consumers are ready
> >>>
> >>>    drivers/cpuidle/Kconfig.arm           |  10 ++
> >>>    drivers/cpuidle/Makefile              |   5 +-
> >>>    drivers/cpuidle/cpuidle-psci-domain.c |  74 +++++++++-----
> >>>    drivers/cpuidle/cpuidle-psci.c        | 141 +++++++++++++++-----------
> >>>    drivers/cpuidle/cpuidle-psci.h        |  11 +-
> >>>    5 files changed, 150 insertions(+), 91 deletions(-)
> >>>
> >>
> >> Since I am interested in some CPU idle statistics (residency, etc),
> >> I would like to help you and Sudeep in reviewing the patch set.
> >
> > Thanks, much appreciated!
> >
> >>
> >> Could you clarify some bit below?
> >> 1. There is Qcom SoC which has dependencies between PSCI PM domain
> >> consumers and this CPU idle - thus we cannot register and use CPU
> >> idle driver till related drivers fully setup.
> >
> > I think you got it right, but let me clarify.
> >
> > On Qcom SoC, PSCI PM domain consumers aren't solely CPU devices, but
> > also the 'qcom,rpmh-rsc' device is a consumer, for example.
> >
> > That doesn't mean the CPU idle driver can't be probed/initialized, but
> > rather that the PSCI PM domain must not be powered off. The power off
> > needs to wait until all the consumers of the PSCI PM domain have been
> > registered/probed.
> >
> > See more details in the commit message of patch5.
> >
> >> 2. The proposed solution is to use platform driver and plat. device
> >> for this CPU idle driver, to have access to deferred probe mechanism and
> >> wait for the consumer drivers fully probed state.
> >
> > Correct, but let me fill in some more.
> >
> > I would like to use the ->sync_state() callback of the PSCI PM domain
> > driver, as a way to understand that all consumers have been probed.
> >
> >> 3. Do you have maybe some estimations how long it takes for these
> >> consumers to be fully probed?
> >
> > I am not sure I understand the reason for the question.
>
> I was wondering if this is because of HW issue of long setup, thus
> we need to wait a bit longer with drivers deferred probing.
> But this is not the case as I can see now.
>
>
> >
> > Anyway, at this point, I am looking at the qcom,rpmh-rsc device, which
> > is being probed by the drivers/soc/qcom/rpmh-rsc.c driver. Moving
> > forward, in principle it can be any device/driver that is a consumer
> > of the PSCI PM domain. I am not even excluding that drivers can be
> > modules. It should work for all cases.
>
> The late_initcall won't help, this is a really tough requirement:
> being a module...
>
>
> >
> >> 4. Changing just this CPU idle driver registration point (to
> >> late_initcall()) phase in time is not a solution.
> >
> > Correct, it doesn't work.
> >
> > Playing with initcalls doesn't guarantee anything when it comes to
> > making sure all consumers are ready.
>
> I agree, especially when modules are involved.
>
> >
> > Hope this clarifies things a bit for you, but just tell me if there is
> > anything more I can do to further explain things.
>
> Yes, thank you. I can see now why you need this explicit ->sync_state()
> callback.
> I don't see better solution to what you have proposed here.
> I will go through the patches once again to check and add some
> reviewed-by.
>

Thanks a lot for your time! I am just about to post a v2, to re-order
the series so patch 3 comes first, according to suggestions from Lina.

Please move over to review that version instead, in a few minutes.

Kind regards
Uffe

  reply	other threads:[~2020-07-07 12:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 15:20 [PATCH 0/5] cpuidle: psci: Various improvements for PSCI PM domains Ulf Hansson
2020-06-15 15:20 ` [PATCH 1/5] cpuidle: psci: Fail cpuidle registration if set OSI mode failed Ulf Hansson
2020-06-18 18:01   ` Lina Iyer
2020-06-26 14:33   ` Sudeep Holla
2020-06-26 14:47     ` Sudeep Holla
2020-06-15 15:20 ` [PATCH 2/5] cpuidle: psci: Fix error path via converting to a platform driver Ulf Hansson
2020-06-26 14:42   ` Sudeep Holla
2020-06-26 23:06     ` Ulf Hansson
2020-06-15 15:20 ` [PATCH 3/5] cpuidle: psci: Split into two separate build objects Ulf Hansson
2020-06-18 18:02   ` Lina Iyer
2020-06-26 14:44   ` Sudeep Holla
2020-06-15 15:20 ` [PATCH 4/5] cpuidle: psci: Convert PM domain to platform driver Ulf Hansson
2020-06-23 17:21   ` Lina Iyer
2020-06-15 15:20 ` [PATCH 5/5] cpuidle: psci: Prevent domain idlestates until consumers are ready Ulf Hansson
2020-06-15 18:05   ` Saravana Kannan
2020-06-16  6:49     ` Ulf Hansson
2020-06-16  7:05       ` Saravana Kannan
2020-06-24  9:57 ` [PATCH 0/5] cpuidle: psci: Various improvements for PSCI PM domains Ulf Hansson
2020-06-30 10:23 ` Lukasz Luba
2020-07-07 11:53   ` Ulf Hansson
2020-07-07 12:37     ` Lukasz Luba
2020-07-07 12:51       ` Ulf Hansson [this message]
2020-07-07 13:26         ` Lukasz Luba

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=CAPDyKFpc+LKZ8Khjau9iLD0YJTHvqav2HD4+aDhMaPpSEXPawA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --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=rjw@rjwysocki.net \
    --cc=saravanak@google.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    --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).