linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: bjorn.andersson@sonymobile.com (Bjorn Andersson)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 0/2] Qualcomm RPM sleep states
Date: Wed, 26 Nov 2014 15:34:47 -0800	[thread overview]
Message-ID: <20141126233447.GD2872@sonymobile.com> (raw)
In-Reply-To: <20141125204430.GN7712@sirena.org.uk>

On Tue 25 Nov 12:44 PST 2014, Mark Brown wrote:

> On Mon, Nov 24, 2014 at 01:19:47PM -0800, Stephen Boyd wrote:
> > On 11/24/2014 10:16 AM, Mark Brown wrote:

[..]

> > respectively. The RPM regulator driver aggregates the active set for
> > both the regulators via a max() operation and sends that as a request to
> > the RPM. The sleep set is the same as the active set for the 'active +
> > sleep' regulator, so we just send whatever the value is that was sent
> > down via the regulator APIs on the 'active + sleep' regulator. The only
> > driver that really cares about the active only regulators is the CPU
> > clock driver. Otherwise drivers are using the active + sleep regulators
> > because their devices don't stop running when the CPU goes to idle/suspend.
> 
> Hang on a minute.  What you're saying seems to be that this isn't really
> about suspend but actually about the normal operating configuration?
> That makes it a bit more understandable why one would change the
> settings a lot, I think what I'm hearing here is that the runtime state
> changes a lot for some reason and the system needs the suspend state to
> track this?
> 

I think it's important that we clarify that we have 2 (somewhat) diffrent
problem on the table here:

Problem 1:
Regulators are shared between CPU PLLs and other peripherals and when we take
the cpu to idle we need a way to let go of the CPU PLL "vote" on the regulator.

In the case of the CPU being the only consumer I think we've come down to the
problems being:
* we're in atomic context
* we don't want to waste the time of making sending out the request
* we have hardware support for this and we want to use it(?)

In the case of us having other active consumers (e.g. GPU, display or some
peripherals) the voltage range or operating mode specified by the cpufreq
driver might be suboptimal when we remove the cpu.

I assume we don't want to handle this explicitly due to the same reasons as
above(?)


Problem 2:
As we're implementing a solution for problem 1 we end up with a set of writes
to the sleep state that are superfluous. The codeaurora solution for this is to
buffer any writes to the sleep state and right before putting the cpu into idle
state there's a direct call going, that flushes the buffered writes.

This is "only" and optimization and I think the tricky parts are how to
actually trigger the flush from the cpuidle driver and how to handle the smd
communication in a sane way.

> I can't help but think that this all sounds like the RPM isn't mapping
> very well onto practical systems and needs revisiting in future
> versions...  for example with what I'm parsing out of the above an
> active+sleep set command or otherwise having the two modes tied together
> for some regulators would make the whole problem go away.
> 

As Stephen answered for regulators that only have the "both state" only one
write is needed.

And if I read the docs correctly there are 4 regulators that needs this special
handling and 29 that works just as you normally would expect.

> > Maybe another solution would be to push the problem into the regulator
> > core and educate it about the two different sets. RPM resources would
> > map one-to-one with a regulator and the sleep set and active sets would
> > be selectable via the regulator_get() API or some other consumer mapping
> > method. This would allow consumers to request whatever set they care
> > about and consolidate the aggregation logic that's duplicated at the
> > consumer level and the driver level into the core.
> 
> I think any duplication that's going on sounds like a consequence of
> the way this is currently implemented.  I think based on what I *think*
> you're saying the RPM driver probably ought to be hiding this and adding
> a property which makes the active and sleep sets track each other with
> normal suspend mode control otherwise.  That could potentially be done
> in the core, though the tracking would be substantial surgery.

I think we should start off by hiding this in the driver, if others come
forward needing something similar we can look at how to integrate parts of it
into the core.

Regards,
Bjorn

  parent reply	other threads:[~2014-11-26 23:34 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 22:52 [RFC 0/2] Qualcomm RPM sleep states Bjorn Andersson
2014-11-10 22:52 ` [RFC 1/2] mfd: qcom-rpm: Expose sleep state resources to clients Bjorn Andersson
2014-11-11 12:04   ` Lee Jones
2014-11-11 18:33     ` Bjorn Andersson
2014-11-12  9:52       ` Lee Jones
2014-11-12 14:45         ` Lina Iyer
2014-11-12 19:23           ` Bjorn Andersson
2014-11-19 18:06             ` Lina Iyer
2014-11-12 19:55         ` Bjorn Andersson
2014-11-10 22:52 ` [RFC 2/2] regulator: qcom-rpm: Implement RPM assisted disable Bjorn Andersson
2014-11-11  9:11   ` Andreas Färber
2014-11-11 18:34     ` Bjorn Andersson
2014-11-11 11:59   ` Lee Jones
2014-11-11 18:39     ` Bjorn Andersson
2014-11-11 14:21   ` Javier Martinez Canillas
2014-11-11 19:23     ` Bjorn Andersson
2014-11-21 23:10 ` [RFC 0/2] Qualcomm RPM sleep states Stephen Boyd
2014-11-21 23:27   ` Mark Brown
2014-11-21 23:43     ` Stephen Boyd
2014-11-21 23:54       ` Mark Brown
2014-11-22  0:03         ` Stephen Boyd
2014-11-22  0:16         ` Bjorn Andersson
2014-11-24 18:16       ` Mark Brown
2014-11-24 21:19         ` Stephen Boyd
2014-11-25 20:44           ` Mark Brown
2014-11-26  1:02             ` Stephen Boyd
2014-11-26 13:40               ` Mark Brown
2014-11-27  1:51                 ` Stephen Boyd
2014-11-27 18:56                   ` Mark Brown
2014-11-26 23:34             ` Bjorn Andersson [this message]
2014-11-27 19:02               ` Mark Brown
2014-11-27 19:42                 ` Bjorn Andersson
2014-11-28 20:16                   ` Mark Brown
2014-12-04 21:15                     ` Stephen Boyd
2014-12-08 18:06                       ` Bjorn Andersson
2014-12-08 19:39                         ` Mark Brown
2014-12-08 20:55                           ` Bjorn Andersson
2014-12-09 18:16                             ` Mark Brown
2014-12-09 19:25                               ` Bjorn Andersson
2014-12-09 20:28                                 ` Mark Brown
2014-12-11 22:36                                   ` Bjorn Andersson
2014-12-15 18:04                                     ` Mark Brown
2014-12-16  6:05                                       ` Bjorn Andersson
2014-12-26 17:09                                         ` Mark Brown
2014-12-29 21:54                                           ` Bjorn Andersson
2014-12-30 16:43                                             ` Mark Brown
2014-11-24 17:02   ` Bjorn Andersson
2014-11-24 21:19     ` Stephen Boyd
2014-11-24 21:59       ` Bjorn Andersson
2014-11-25  0:02         ` Stephen Boyd
2014-11-26 22:49           ` Bjorn Andersson

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=20141126233447.GD2872@sonymobile.com \
    --to=bjorn.andersson@sonymobile.com \
    --cc=linux-arm-kernel@lists.infradead.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).