All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/2] Qualcomm RPM sleep states
@ 2014-11-10 22:52 ` Bjorn Andersson
  0 siblings, 0 replies; 102+ messages in thread
From: Bjorn Andersson @ 2014-11-10 22:52 UTC (permalink / raw)
  To: Stephen Boyd, David Collins, Lina Iyer, Mark Brown
  Cc: Lee Jones, linux-arm-kernel, linux-arm-msm

During the review of the Qualcomm SMD RPM regulators [1], I got (offline)
feedback that my implementation did not handle "sleep states". As the problem
is shared between all families of Qualcomm platforms I use [2] (family A) to
propose a solution (as I hope to get that merged sooner).

The "sleep states" comment boils down to certain regulators (or rpm resources
in general) are used by the currently clocked/running CPU(s) and can not be
disabled while we're still running. Further more, these resources are shared
with peripherals in the system; e.g. LDO12 on PM8941 is used to clock the CPU
and WiFi/BT PLLs as well as providing power to the display in our devices. So
the suspend functionality in the regulator framework doesn't cut it.


The downstream solution to this is to expose 3 regulators per regulator
resource, each specified to control the active mode, sleep mode or both modes
respectively. Peripherals are directed to use the "both" regulator while the
CPUs are directed to the "active only" regulator.

After reviewing this solution and looking at what it's actually achieving I
here propose flagging these regulators to have "deferred disable";
* we consider the specific regulators as always-on _while running_
* hence, disable and enable affect only the sleep state
* we update both active and sleep state with all other properties

This gives us a single regulator exposed for the resource, that will be kept on
with parameters as specified by the clients if it's referenced and upon loosing
the last reference (disabling all consumers) it will be turned off when the
CPU(s) are sleeping.


As far as I can see this should give the same behaviour as we have downstream,
without the need for playing tricks with how we expose the regulators. However
there's plenty of details hidden in that code, so I hope to get some feedback
from the Qualcomm engineers on this.


The first patch in the series applies on top of [2], it should be squashed with
1 & 2 of [2] and is only included for completeness.

[1] https://lkml.org/lkml/2014/9/29/747
[2] https://lkml.org/lkml/2014/9/22/731

Bjorn Andersson (2):
  mfd: qcom-rpm: Expose sleep state resources to clients
  regulator: qcom-rpm: Implement RPM assisted disable

 Documentation/devicetree/bindings/mfd/qcom-rpm.txt |   28 ++++++++
 drivers/mfd/qcom_rpm.c                             |    9 +--
 drivers/regulator/qcom_rpm-regulator.c             |   67 +++++++++++++++-----
 include/linux/mfd/qcom_rpm.h                       |    5 +-
 4 files changed, 88 insertions(+), 21 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 102+ messages in thread

end of thread, other threads:[~2014-12-30 16:44 UTC | newest]

Thread overview: 102+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-10 22:52 [RFC 0/2] Qualcomm RPM sleep states Bjorn Andersson
2014-11-10 22:52 ` Bjorn Andersson
2014-11-10 22:52 ` [RFC 1/2] mfd: qcom-rpm: Expose sleep state resources to clients Bjorn Andersson
2014-11-10 22:52   ` Bjorn Andersson
2014-11-11 12:04   ` Lee Jones
2014-11-11 12:04     ` Lee Jones
2014-11-11 18:33     ` Bjorn Andersson
2014-11-11 18:33       ` Bjorn Andersson
2014-11-12  9:52       ` Lee Jones
2014-11-12  9:52         ` Lee Jones
2014-11-12 14:45         ` Lina Iyer
2014-11-12 14:45           ` Lina Iyer
2014-11-12 19:23           ` Bjorn Andersson
2014-11-12 19:23             ` Bjorn Andersson
2014-11-19 18:06             ` Lina Iyer
2014-11-19 18:06               ` Lina Iyer
2014-11-12 19:55         ` Bjorn Andersson
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-10 22:52   ` Bjorn Andersson
2014-11-11  9:11   ` Andreas Färber
2014-11-11  9:11     ` Andreas Färber
2014-11-11 18:34     ` Bjorn Andersson
2014-11-11 18:34       ` Bjorn Andersson
2014-11-11 11:59   ` Lee Jones
2014-11-11 11:59     ` Lee Jones
2014-11-11 18:39     ` Bjorn Andersson
2014-11-11 18:39       ` Bjorn Andersson
2014-11-11 14:21   ` Javier Martinez Canillas
2014-11-11 14:21     ` Javier Martinez Canillas
2014-11-11 19:23     ` Bjorn Andersson
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:10   ` Stephen Boyd
2014-11-21 23:27   ` Mark Brown
2014-11-21 23:27     ` Mark Brown
2014-11-21 23:43     ` Stephen Boyd
2014-11-21 23:43       ` Stephen Boyd
2014-11-21 23:54       ` Mark Brown
2014-11-21 23:54         ` Mark Brown
2014-11-22  0:03         ` Stephen Boyd
2014-11-22  0:03           ` Stephen Boyd
2014-11-22  0:16         ` Bjorn Andersson
2014-11-22  0:16           ` Bjorn Andersson
2014-11-24 18:16       ` Mark Brown
2014-11-24 18:16         ` Mark Brown
2014-11-24 21:19         ` Stephen Boyd
2014-11-24 21:19           ` Stephen Boyd
2014-11-25 20:44           ` Mark Brown
2014-11-25 20:44             ` Mark Brown
2014-11-26  1:02             ` Stephen Boyd
2014-11-26  1:02               ` Stephen Boyd
2014-11-26 13:40               ` Mark Brown
2014-11-26 13:40                 ` Mark Brown
2014-11-27  1:51                 ` Stephen Boyd
2014-11-27  1:51                   ` Stephen Boyd
2014-11-27 18:56                   ` Mark Brown
2014-11-27 18:56                     ` Mark Brown
2014-11-26 23:34             ` Bjorn Andersson
2014-11-26 23:34               ` Bjorn Andersson
2014-11-27 19:02               ` Mark Brown
2014-11-27 19:02                 ` Mark Brown
2014-11-27 19:42                 ` Bjorn Andersson
2014-11-27 19:42                   ` Bjorn Andersson
2014-11-28 20:16                   ` Mark Brown
2014-11-28 20:16                     ` Mark Brown
2014-12-04 21:15                     ` Stephen Boyd
2014-12-04 21:15                       ` Stephen Boyd
2014-12-08 18:06                       ` Bjorn Andersson
2014-12-08 18:06                         ` Bjorn Andersson
2014-12-08 19:39                         ` Mark Brown
2014-12-08 19:39                           ` Mark Brown
2014-12-08 20:55                           ` Bjorn Andersson
2014-12-08 20:55                             ` Bjorn Andersson
2014-12-09 18:16                             ` Mark Brown
2014-12-09 18:16                               ` Mark Brown
2014-12-09 19:25                               ` Bjorn Andersson
2014-12-09 19:25                                 ` Bjorn Andersson
2014-12-09 20:28                                 ` Mark Brown
2014-12-09 20:28                                   ` Mark Brown
2014-12-11 22:36                                   ` Bjorn Andersson
2014-12-11 22:36                                     ` Bjorn Andersson
2014-12-15 18:04                                     ` Mark Brown
2014-12-15 18:04                                       ` Mark Brown
2014-12-16  6:05                                       ` Bjorn Andersson
2014-12-16  6:05                                         ` Bjorn Andersson
2014-12-26 17:09                                         ` Mark Brown
2014-12-26 17:09                                           ` Mark Brown
2014-12-29 21:54                                           ` Bjorn Andersson
2014-12-29 21:54                                             ` Bjorn Andersson
2014-12-30 16:43                                             ` Mark Brown
2014-12-30 16:43                                               ` Mark Brown
2014-11-24 17:02   ` Bjorn Andersson
2014-11-24 17:02     ` Bjorn Andersson
2014-11-24 21:19     ` Stephen Boyd
2014-11-24 21:19       ` Stephen Boyd
2014-11-24 21:59       ` Bjorn Andersson
2014-11-24 21:59         ` Bjorn Andersson
2014-11-25  0:02         ` Stephen Boyd
2014-11-25  0:02           ` Stephen Boyd
2014-11-26 22:49           ` Bjorn Andersson
2014-11-26 22:49             ` Bjorn Andersson

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.