From: David Brownell <david-b@pacbell.net>
To: linux-pm@lists.osdl.org
Subject: Re: PM docs and API?
Date: Wed, 7 Jun 2006 15:58:09 -0700 [thread overview]
Message-ID: <200606071558.09980.david-b@pacbell.net> (raw)
In-Reply-To: <448721B6.5080400@linuxtoys.org>
On Wednesday 07 June 2006 11:57 am, bsmith wrote:
> Where can I find the latest documentation for the PM APIs in Linux?
AFAIK there's nothing worth reading just now. I have a patch that
may make some of the linux/Documentation stuff more correct and
comprehensible, but it's not quite ready yet.
> Specifically, where can I read about the API that a device driver
> should offer to make it "power manageable".
The fundamental device driver power management hook is to participate
in system-wide suspend and resume operations ... the stuff that happens
with "echo standby > /sys/power/state", as one example, which triggers
platform-specific implementations of the "struct pm_ops" calls.
Drivers based on the driver model all connect to some bus and will
implement suspend() and resume() methods. Those methods will put
devices into low power states using hardware-specific mechanisms.
For example, with PCI PM support the pci_set_power_state() routine
is used. SOC based systems routinely use <linux/clk.h> APIs to
gate clocks to the relevant portion of silicon. The resume() call
generally reverses the effect of suspend(); sometimes it needs to
recover from a hardware reset, or force one, and reinitialize.
Drivers based on the driver model may also be able to make the
hardware issue wakeup events. For wakeup-capable hardware, the
sysfs /sys/devices/.../power/wakeup flag can be changed from
user mode code. Drivers are responsible for looking at that flag
during suspend().
There's also just being "power aware", for example by drivers
turning off power supplies and clocks they're not actively using,
and otherwise staying in the state with the lowest power drain
that's practical for the current level of device usage.
IMO the most significant hole in device driver support for PM is
that the system doesn't expose relevant aspects of the upcoming
power state that suspend() is there to support. You can see one
fix for that in the clk_must_disable() API that I sent to this
list for comment a while back ... I think I'll just submit it for
general merge, it's impossible for embedded USB controllers to
support wakeup events without that.
Another hole in device driver support for PM is a basic platform
neutral API for managing power domains ... like "turn on the 3.0V
supply going to MMC slot 2" (or maybe that needs 1.8V instead).
Lacking such an API, all those calls are board-specific: this
board uses a native GPIO call, that one uses an external power
switch, another one has programmable output voltage, etc.
For platform PM support, there are several things that apply:
- Providing pm_ops through a pm_set_ops() call. When the
system is asked to go into e.g. STANDBY or STR state, the
drivers are all asked to suspend and then pm_ops methods
are used to do things like put memory into self-refresh
mode and entering appropriate low-power modes if the drivers
didn't misbehave (e.g. all necessary clocks got disabled)
and other constraints are met (e.g. switch from 1.6V for
main power supply down to 1.1V).
- On ARM (and at some point, more generically) implementing
dynamic tick (CONFIG_NO_IDLE_HZ) in the system timer driver
so that the system doesn't needlessly waste energy issuing
and responding to timer IRQs. It's common that this puts
the tick rate down to 6-8 HZ ... with timer precision still
being arbitrarily good.
- Where the system supports it, cpufreq essentially provides
a class of driver for CPUs. There's discussion about growing
this to provide better support for voltage scaling, rather
than purely CPU scaling.
- There's also a potential "pm_idle" mechanism, whereby the
system idle process can kick in extra power savings.
So without the pm_set_ops() stuff, the only driver-level PM stuff
that matters is automatically throttling down power usage.
- Dave
next prev parent reply other threads:[~2006-06-07 22:58 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 21:29 [patch/rft 2.6.17-rc2] swsusp resume must not device_suspend() David Brownell
2006-04-24 21:47 ` [linux-pm] " Rafael J. Wysocki
2006-04-24 22:47 ` David Brownell
2006-04-25 10:34 ` Nigel Cunningham
2006-04-25 14:41 ` Alan Stern
2006-04-25 17:37 ` [linux-pm] " David Brownell
2006-04-25 20:45 ` Alan Stern
2006-04-26 0:30 ` David Brownell
2006-04-27 8:20 ` Pavel Machek
2006-04-27 8:16 ` Pavel Machek
2006-04-27 8:08 ` Pavel Machek
2006-04-27 14:34 ` [linux-pm] " Alan Stern
2006-04-27 16:55 ` Patrick Mochel
2006-04-27 17:41 ` Alan Stern
2006-04-27 19:21 ` David Brownell
2006-04-27 20:35 ` Nigel Cunningham
2006-04-27 20:58 ` Pavel Machek
2006-04-25 16:56 ` David Brownell
2006-04-24 22:31 ` [linux-pm] " Nigel Cunningham
2006-04-25 8:32 ` Rafael J. Wysocki
2006-04-25 16:11 ` David Brownell
2006-04-25 18:56 ` Rafael J. Wysocki
2006-04-25 20:28 ` Nigel Cunningham
2006-04-25 20:53 ` [linux-pm] " Rafael J. Wysocki
2006-04-25 21:03 ` Nigel Cunningham
2006-04-25 22:06 ` Rafael J. Wysocki
2006-04-25 22:18 ` Nigel Cunningham
2006-04-25 22:34 ` Rafael J. Wysocki
2006-04-25 23:55 ` David Brownell
2006-04-26 1:16 ` Nigel Cunningham
2006-04-26 3:32 ` [linux-pm] " David Brownell
2006-04-26 3:44 ` Nigel Cunningham
2006-04-26 14:24 ` Alan Stern
2006-04-26 19:47 ` [linux-pm] " Nigel Cunningham
2006-04-25 21:04 ` David Brownell
2006-04-25 21:41 ` Pavel Machek
2006-04-25 23:13 ` [linux-pm] " David Brownell
2006-04-26 9:07 ` Pavel Machek
2006-04-25 21:55 ` Rafael J. Wysocki
2006-04-25 22:56 ` David Brownell
2006-04-26 11:26 ` Rafael J. Wysocki
2006-04-26 14:38 ` [linux-pm] " Alan Stern
2006-04-26 15:26 ` Rafael J. Wysocki
2006-04-26 15:38 ` Alan Stern
2006-04-26 16:09 ` Rafael J. Wysocki
2006-04-26 19:06 ` Alan Stern
2006-04-26 20:37 ` Rafael J. Wysocki
2006-04-26 21:31 ` David Brownell
2006-04-26 22:24 ` Rafael J. Wysocki
2006-04-27 19:44 ` David Brownell
2006-04-25 15:56 ` David Brownell
2006-04-27 10:54 ` Pavel Machek
2006-04-25 13:50 ` [linux-usb-devel] " Alan Stern
2006-04-25 15:49 ` David Brownell
2006-04-27 1:22 ` Patrick Mochel
2006-04-27 19:41 ` [linux-pm] " David Brownell
2006-05-02 16:12 ` Patrick Mochel
2006-05-26 3:06 ` David Brownell
2006-05-26 19:50 ` Rafael J. Wysocki
2006-05-26 23:16 ` Pavel Machek
2006-05-27 0:19 ` [linux-usb-devel] " David Brownell
2006-05-27 16:38 ` Pavel Machek
2006-06-05 15:31 ` David Brownell
2006-06-05 16:36 ` [patch/rft 2.6.17-rc5-git 0/6] PM_EVENT_PRETHAW David Brownell
2006-06-05 16:36 ` [patch/rft 2.6.17-rc5-git 1/6] fix broken/dubious driver suspend() methods David Brownell
[not found] ` <20060530191140.GA4017@ucw.cz>
2006-06-07 0:53 ` David Brownell
2006-06-05 16:37 ` [patch/rft 2.6.17-rc5-git 2/6] add PM_EVENT_PRETHAW David Brownell
2006-05-30 19:17 ` Pavel Machek
2006-06-07 1:02 ` David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 3/6] PM_EVENT_PRETHAW, handle in IDE and PCI David Brownell
2006-05-30 19:21 ` Pavel Machek
2006-06-07 0:51 ` David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 4/6] PM_EVENT_PRETHAW for various graphics cards David Brownell
2006-05-30 19:30 ` Pavel Machek
2006-06-07 1:24 ` David Brownell
2006-06-07 18:57 ` PM docs and API? bsmith
2006-06-07 22:58 ` David Brownell [this message]
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 5/6] PM_EVENT_PRETHAW, handle for USB David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 6/6] PM_EVENT_PRETHAW, issue from PM core David Brownell
2006-05-30 19:28 ` Pavel Machek
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=200606071558.09980.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-pm@lists.osdl.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