linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] regulator: Propagate uA_load requirements up supply chain
Date: Tue, 29 Mar 2011 17:44:59 +0900	[thread overview]
Message-ID: <20110329084458.GD29330@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1301356432-7586-2-git-send-email-collinsd@codeaurora.org>

On Mon, Mar 28, 2011 at 04:53:52PM -0700, David Collins wrote:
> regulator_set_optimum_mode currently only determines the load
> on the specified regulator.  Physically however, this current
> must be provided by regulators further up the supply chain.

This isn't actually true - it's very common for the system to be
designed such that all the regulators are supplied from a single
unregulated system power rail, especially with modern PMICs.

> Add code to handle uA_load propagation up through the regulator
> supply chain in both regulator_set_optimum_mode and drms_uA_update.

So, my main concern here is essentially the same thing I said with
regard to your original posting about the locking - this all seems
like it's the wrong approach and if we just treated supplies the same as
other consumers life would get a lot simpler.  This is adding a lot more
special cases for supplies which feels like it's making the code more
complicated.  Supplied regulators are essentially just consumers and
this is adding more code that diverges the two and makes it hard to
follow what's going on - ideally when dealing with the parent regulator
you shouldn't have to worry about child regulators at all, they should
just look like all the other consumers.

> Add a new regulator operation callback function named
> get_current_required to struct regulator_ops to assist in this
> propagation.  get_current_required will return the input current
> required for a given regulator based on input voltage, output
> voltage, and output current.  It should be able to capture all
> hardware specific current characteristics of a regulator.
> The input current required for a typical linear and switching
> regulator would be simple to describe in this callback.

The other issue here is that I'm concerned about the direction this
appears to be heading given that it seems like in order for this to do
something useful we'd need to start supplying current drain information
from consumers.  We're not doing that at the minute and I'm not terribly
optimistic that we'd ever get enough useful information to make it
generally worthwhile.

Besides, the interesting stuff tends to be around response to sudden
changes in load and that's basically all been pushed down into hardware
as there's no way for software to propagate the information fast enough.
For software you tend to have to assume the worst case load but that
will usually be a massive overestimate, and of course transients will be
absorbed by the passives to a certain extent which complicates matters
further.

Perhaps if you could explain your use case for this things might become
clearer?

  reply	other threads:[~2011-03-29  8:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 15:34 [PATCH 0/2] regulator: Fix regulator_enable deadlock and add uA_load propagation David Collins
2011-03-28 15:34 ` [PATCH 1/2] regulator: Remove possible deadlock from regulator_enable David Collins
2011-03-28 18:11   ` Mark Brown
2011-03-28 18:22     ` David Collins
2011-03-28 15:34 ` [PATCH 2/2] regulator: Propagate uA_load requirements up supply chain David Collins
2011-03-28 18:02   ` Mark Brown
2011-03-28 18:14     ` Russell King - ARM Linux
2011-03-29  7:53       ` Mark Brown
2011-03-29  8:28         ` Russell King - ARM Linux
2011-03-29  8:40           ` Mark Brown
2011-03-28 18:18     ` David Collins
2011-03-28 18:33       ` broonie@gmail.com
2011-03-28 23:52 ` [PATCH v2 0/2] regulator: Fix regulator_enable deadlock and add uA_load propagation David Collins
2011-03-28 23:53   ` [PATCH v2 1/2] regulator: Remove possible deadlock from regulator_enable David Collins
2011-03-28 23:53   ` [PATCH v2 2/2] regulator: Propagate uA_load requirements up supply chain David Collins
2011-03-29  8:44     ` Mark Brown [this message]
2011-03-29 16:08       ` David Collins
2011-03-29 21:20         ` Mark Brown
2011-03-30  1:00           ` Mark Brown
2011-03-29 22:40     ` Mark Brown

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=20110329084458.GD29330@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.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).