linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A new Subsystem for Current Management
@ 2011-11-10 11:28 R, Durgadoss
  2011-11-10 15:04 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: R, Durgadoss @ 2011-11-10 11:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-embedded@vger.kernel.org

Hi Mark,

> 
> > In simple terms, this framework will offer something like this:
> > 	Current[1-N]_limit - set of current limits
> > 	Voltage[1-X]_limit - set of voltage limits
> 
> What would the voltage limits be?  Whatever is going on here there
> should be some integration with the regulator framework, modern
> regulators are often able to report when they go out of regulator and
> able to impose current limits.

These (limits) are configurable voltage limits. The HW generates an
Interrupt when any of these configured voltage limits are crossed.
Similarly, for Current also.

Now, Say there are 3 current limits that we can program.
On the first and second limit violation we take some actions,
and control the current consumption, so that it does not hit the
worst current limit.

Do you think, we can fit this into the regulator framework ?

I went through the regulator framework inside Linux-3.1.
I could see the core driver and lot of regulator drivers using the Framework.
But I would like to see a 'consumer' driver that uses the framework
efficiently, so that I can get some more idea. Could you point to
some source files ?

Thanks,
Durga

^ permalink raw reply	[flat|nested] 7+ messages in thread
* A new Subsystem for Current Management
@ 2011-11-08 11:09 R, Durgadoss
  2011-11-08 11:15 ` Felipe Balbi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: R, Durgadoss @ 2011-11-08 11:09 UTC (permalink / raw)
  To: linux-embedded@vger.kernel.org

Hi All,

[Very Sorry for the Big Email]

[I have posted this on lm-sensors and platform-drivers-x86
lists earlier. As per some recommendations there, posting it
here]

As we all know, Linux is increasingly being used in handhelds.
The Hardware that supports the handhelds is also becoming
Performance-centric. With this, we need a way to efficiently
monitor the current consumption of the platform and take actions
when the platform draws more current, than it should.

Where this can happen ?
-----------------------
In a handheld, there are many components that demand high
Current. For example, Camera Flash, Video Streaming, 3G Voice
Call etc. Typically, two or more of these components are used
simultaneously in a real-time scenario. When this happens, the
current draw of the platform surges. If this surge lasts for
more than a specific time, it could crash the platform irrecoverably.

How do we tackle this ?
-----------------------
In Intel Medfield (Atom based) platform we had a driver that
Configures the current limits. When the platform current draws
more current than the programmed limit, the hardware generates
interrupt. The driver receives this interrupt and notifies the
user space to take appropriate actions.
The patch and the subsequent discussions can be found here:
http://comments.gmane.org/gmane.linux.drivers.platform.x86.devel/1197

To Generalize:
--------------
With many more platforms to come, having a separate driver for each
results in heavy code duplication. Also, there arises a problem of
where to put these kind of drivers ? Hence I propose the idea of having
a Current Management subsystem.

This will provide a generic ABI, API, so that the platform specific
drivers can register with this framework (and thus avail the basic
needs) and handle the events in their own way.

In simple terms, this framework will offer something like this:
	Current[1-N]_limit - set of current limits
	Voltage[1-X]_limit - set of voltage limits
	Controllers[1-Y]_enable - These are the components by throttling/
      disabling which the current consumption can be brought down.

With the Controllers we can follow two approaches:
A) Each component driver registers with the current framework and gets
notified when the current surge happens. On receiving the notification,
it throttles its performance. There will be a follow-up notification,
indicating that 'we are out of the high current' situation; so that
the component resumes to operation at its full performance.

B) The Current framework forwards the notification to the upper
layers and lets them decide what to do.

I agree that A) bloats the size of all the component drivers a bit,
but considering the fact that the surge has to be brought down as
soon as possible (and the delay in reacting to the event if we
pass it to the upper layers) I am inclined towards A).

I would like to see the opinion of the community on this entire
stuff, before I start writing some code.

Please Help,
Durga

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

end of thread, other threads:[~2011-11-10 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 11:28 A new Subsystem for Current Management R, Durgadoss
2011-11-10 15:04 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2011-11-08 11:09 R, Durgadoss
2011-11-08 11:15 ` Felipe Balbi
2011-11-08 11:25   ` R, Durgadoss
2011-11-08 11:58 ` Christian Gagneraud
2011-11-08 13:56 ` Mark Brown

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