From: David Brownell <david-b@pacbell.net>
To: linux-pm@lists.osdl.org
Subject: Re: [RFC] Linux Power Management
Date: Sun, 8 May 2005 11:35:56 -0700 [thread overview]
Message-ID: <200505081135.56811.david-b@pacbell.net> (raw)
In-Reply-To: <20050505043920.GB21223@neo.rr.com>
[-- Attachment #1: Type: text/plain, Size: 4737 bytes --]
On Wednesday 04 May 2005 9:39 pm, Adam Belay wrote:
> On Tue, May 03, 2005 at 11:52:45AM -0400, Alan Stern wrote:
> > On Tue, 3 May 2005, Adam Belay wrote:
> >
> > You said explicitly that power devices may or may not coincide with struct
> > devices in the driver model. Why do you want to do this? Why not insist
> > that power devices _are_ struct devices? It would make many things a lot
> > easier and allow much more code sharing plus reduction of memory usage.
> > (Kobjects aren't cheap, especially for embedded systems.)
>
> I think you make a good point. My original intention here was to support
> strange power relationships that do not match the device tree.
In fact, that's why "struct dev_pm_info" has a "pm_parent". Today.
And device_pm_set_parent() ... which I don't necessarily think would
work, if anyone were to use it. That information is invisible through
sysfs, note!
Hmm, I think I'll post a patch I've had sitting around for a while,
to at least report violation of the relevant integrity constraints.
It doesn't solve the problem that a pm_parent won't automatically
know about its children though, for example. That's something I
liked about Adam's direction: formalizing that relationship.
> However, I
> don't think this will be common, and not every layer in between the tree
> has to participate. So, psuedo-logical device layers like we're seeing in the
> PCI express bus driver could just be skipped past. I'll change my plans to
> reflect this.
When you "don't think this will be common" you're basically assuming
Linux won't be used on embedded hardware. Unhealthy assumption!!
It's **really easy** and in fact natural for hardware designers to
provide power management relationships that don't directly match
the logical bus structure that software likes to use. Chips to
switch power are in widespread use, and the GPIO lines used to drive
them don't always come from a CPU (where they'd probably be always
available unless the CPU itself suspends).
The way those systems manage to work at all on 2.6 relies on several
things, in the systems I've seen.
* System initialization order changes like subsys_initcall for
I2C not device_initcall, also for the power switching device.
That way, power can be turned on by board-specific logic in
drivers for either (a) the power switching devices, or even
better (b) the device whose power is switched knows how
to ask the power-switch driver to give it power. (Since
they can rely on the switching device to be "live" by then.)
* Despite the fact that sysfs exposes power/state, nobody is
actually using that for anything except very selective
testing ... so the deep brokenneses that _could_ happen is
quite unlikely; we don't expect userspace to selectively
suspend a parent without having suspended its child.
(The device drivers use selective suspend all the time,
but they know not to do such stuff.)
You'll observe that this entirely bypasses the driver model
PM structure, using init sequencing instead. So until someone
tries to use sysfs for selective suspend, it can't matter
that some I2C device is actually controlling power for every
device in the system (CPU included!) yet isn't the driver
model parent of any one of them...
The fact that these systems can even boot under Linux relies on
board-specific logic to handle the things that the pmcore model
was allegedly "designed to handle". Arguably it's better to have
code in driver X that just says "driver Y, please set GPIO 3 high"
since anything less direct is just wasted code ... but if so, then
what's the relevance of pmcore here? What _should_ pmcore do for
normal board configurations like that?
> > Anything else? This list in itself doesn't require much in the way of
> > policy management.
>
> Wake devices would also require userspace configuration of policy.
I'll definitely repost my patch adding that policy support; I've got
it updated, after all! And the PCI-E changes to access PCI config
space "early" seem to have laid to rest concerns about whether that's
safe to do, so that simplifies the PCI stuff too.
> I appreciate your comments. To sumarize, I'd like to introduce power
> resources into our current PM model and add a concept of device power states.
That is, distinct from dev_pm_info.power_state? That notion is rather
bogus, and AFAICT is there _only_ to support sysfs selective suspend.
And the sysfs support for selective suspend is pretty bogus -- it doesn't
do recursion, dev_pm_info.power_state updates are iffy, and it obviously
can't preserve the pm parent/child relationships -- that whole area does
need much work/replacement.
- Dave
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2005-05-08 18:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-03 4:32 [RFC] Linux Power Management Adam Belay
2005-05-03 6:06 ` Nigel Cunningham
2005-05-03 15:52 ` Alan Stern
2005-05-05 4:39 ` Adam Belay
2005-05-08 18:35 ` David Brownell [this message]
2005-05-09 9:49 ` Pavel Machek
2005-05-09 16:41 ` David Brownell
2005-05-09 19:30 ` Pavel Machek
2005-05-03 21:40 ` Pavel Machek
2005-05-05 4:12 ` Adam Belay
2005-05-05 9:38 ` Pavel Machek
2005-05-08 18:39 ` David Brownell
2005-05-09 8:35 ` Pavel Machek
2005-05-08 18:31 ` David Brownell
2005-05-09 3:26 ` Adam Belay
2005-05-09 16:02 ` David Brownell
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=200505081135.56811.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