archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <>
To: Stephan Gerhold <>
Cc: Bjorn Andersson <>,
	Loic Poulain <>,,
Subject: Re: [PATCH] arch: arm64: dts: apq8016-dbc: Add missing cpu opps
Date: Wed, 27 May 2020 12:39:21 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, May 26, 2020 at 10:54:03PM +0200, Stephan Gerhold wrote:
> Speaking of the current solution, I also have to say that (IMO) the
> device tree binding for "required-opps" is rather confusing
> and potentially misleading.
> e.g. for VDD_MX scaling I use
> 	required-opps = <&rpmpd_opp_nom>;
> but looking at just the OPP table absolutely nothing tells me this is
> supposed to apply to VDD_MX. You actually need to go search for the cpu@
> device tree node and then know that some of the power domains there
> (in some order) are eventually going to be used for the required-opps
> there. The order is only defined by the qcom-nvmem-cpufreq driver.
> It took me a few hours to get that right... :)
> Nevertheless I guess we need a solution for scaling MEMACC without CPR
> for now. :) I'm not sure if rewriting all this is very realistic
> (if even possible). So I guess we might be stuck with the genpd approach?

I agree, the CPR driver will most likely not be changed now, since we
need to be compatible with the existing device tree.

For DVFS without CPR:

You need to scale APC, MX, MEMACC.

If we don't care about MEMACC, then the existing code in the OPP library
satisfies all our needs.
The problem here is if we need to do MEMACC as well.

I don't think it is proper to implement MEMACC as a power domain
(because it is not). Thus, we can't add it as a required-opp.

Another problem is that MEMACC should be done after regulator_set_voltage()
when scaling up, and before regulator_set_voltage() when scaling down.

So even if MEMACC was a power domain, currently the OPP library does
the _set_required_opps() call in the wrong order needed for MEMACC.

Like you said, the OPP library almost does everything already,
so it probably makes most sense to extend it to your needs,
rather than duplicating most of the code inside dev_pm_opp_set_rate().

I guess what you really want is two new optional callbacks in
dev_pm_opp_set_rate(), one before _generic_set_opp_regulator() and one
after, where you could do the MEMACC thing.

The callbacks need to have a parameter that tells if we are scaling down
or up.

Or, if Viresh doesn't like new function pointers, create a new
OPP_EVENT_* that you can register for, and in that callback you do what
you need.

Or, maybe you can even use the existing CPUFREQ_TRANSITION_NOTIFIER,
how nicely they play when you are using the OPP library.

Kind regards,

  reply	other threads:[~2020-05-27 10:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 17:50 [PATCH] arch: arm64: dts: apq8016-dbc: Add missing cpu opps Loic Poulain
2020-04-01 23:46 ` Bjorn Andersson
2020-04-02  8:13 ` Stephan Gerhold
2020-04-02  9:58   ` Loic Poulain
2020-04-03  1:31   ` Bjorn Andersson
2020-04-03 10:09     ` Stephan Gerhold
2020-04-03 18:00       ` Stephan Gerhold
2020-04-23  4:55         ` Bjorn Andersson
2020-04-26 12:31           ` Stephan Gerhold
2020-05-06 21:18             ` Stephan Gerhold
2020-05-07  5:34               ` Bjorn Andersson
2020-05-08 12:08                 ` Ulf Hansson
2020-05-08 13:42                   ` Stephan Gerhold
2020-05-11  5:29                   ` Viresh Kumar
2020-05-07 10:46               ` Stephan Gerhold
2020-05-21 19:18                 ` Stephan Gerhold
2020-05-23 12:08                   ` Stephan Gerhold
2020-05-27 20:47                     ` Georgi Djakov
2020-05-25 15:32           ` Niklas Cassel
2020-05-25 16:36             ` Stephan Gerhold
2020-05-25 19:44               ` Niklas Cassel
2020-05-26  8:59                 ` Stephan Gerhold
2020-05-26 15:54                   ` Niklas Cassel
2020-05-26 20:54                     ` Stephan Gerhold
2020-05-27 10:39                       ` Niklas Cassel [this message]
2020-05-27 12:04                         ` Stephan Gerhold
2020-05-27 12:59                           ` Niklas Cassel
2020-05-27 20:56                             ` Stephan Gerhold
2020-05-27 23:10                               ` Niklas Cassel
2020-05-28 13:32                                 ` Stephan Gerhold
2020-05-28  4:44                           ` Viresh Kumar
2020-04-28 20:04 ` Amit Kucheria

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* 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).