From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Patrick Mochel <mochel@digitalimplant.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
Pavel Machek <pavel@ucw.cz>, David Brownell <david-b@pacbell.net>
Subject: Re: [RFC] Fix Device Power Management States
Date: Tue, 10 Aug 2004 16:52:30 +1000 [thread overview]
Message-ID: <1092120750.14102.95.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.50.0408092131260.24154-100000@monsoon.he.net>
> It's easy enough to change which order things get stopped/started in. What
> matters more is the conceptual shift in responsibility for who
> stops/starts the devices, or rather their interfaces.
>
> It also requires a mapping from struct device -> struct class_device that
> the drivers will have to initialize.
Yup, but class devices don't follow the bus topology, do they ?
> > What about passing the previous state to restore ? could be useful...
>
> It's saved in dev->power.pm_resume, so drivers can check it.
>
> > Who calls it ? It's the driver calling it's bus or what ? It make no
> > sense to power manage a device before suspending activity... I agree it
> > may be worth splitting dev_start/stop from PM transitions proper, that
> > would help dealing with various policies, however, there are still some
> > dependencies between those, and they all need to be tied to the bus
> > topology.
>
> The driver core calls it in device_power_down() (as was in the patch ;),
> in physical topological order. The ordering of the calls is up the power
> management core, but it just wouldn't make sense to power down a device
> that wasn't stopped. Would be easy enough to add a check for it..
>
> Note it would make sense to power down a device without stopping, if the
> device had no device driver bound to it (e.g. unclaimed devices that are
> in D0 unnecessarily; or unclaimed devices that need to be powered down
> during a suspend transition).
Ok, just be careful with that as some "platform" devices may not have a
driver bound and still don't want to be powered down... but we could
create fake drivers...
> > What about partial tree ? We need to suspend childs first and we need to
> > tied PM transition with dev_start/stop (or have some way to indicate the
> > device we want it to auto-resume when it gets a request, or something).
> > We need to work out policy a bit more here I suppose...
>
> Policy can come later; we have to have a working model first.
>
> As far as partial trees go, it can be done using the posted patch. Think
> about why you want to suspend/resume a partial tree - to use a particular
> leaf device. You know what device it is, and by virtue of the driver
> model, you know each of its ancestors. So, you walk the tree up to the
> root, and restart all the way down. Then, you re-stop it all the way back
> up. Should be ~10 lines of code that is left as an exercise against the
> posted patch. :)
>
>
> Pat
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>
next prev parent reply other threads:[~2004-08-10 6:56 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-09 10:43 [RFC] Fix Device Power Management States Patrick Mochel
2004-08-09 11:38 ` Pavel Machek
2004-08-09 16:02 ` Patrick Mochel
2004-08-09 21:29 ` Pavel Machek
2004-08-10 5:03 ` Patrick Mochel
2004-08-10 9:43 ` Nigel Cunningham
2004-08-10 10:20 ` Pavel Machek
2004-08-10 22:33 ` Nigel Cunningham
2004-08-10 13:58 ` Patrick Mochel
2004-08-10 22:29 ` Nigel Cunningham
2004-08-10 22:56 ` Patrick Mochel
2004-08-10 23:09 ` Nigel Cunningham
2004-08-10 23:36 ` suspend2 merge [was Re: [RFC] Fix Device Power Management States] Pavel Machek
2004-08-11 0:04 ` Arkadiusz Miskiewicz
2004-08-11 5:05 ` Nigel Cunningham
2004-08-11 9:13 ` Pavel Machek
2004-08-10 10:13 ` [RFC] Fix Device Power Management States Pavel Machek
2004-08-10 18:36 ` David Brownell
2004-08-10 20:36 ` Pavel Machek
2004-08-10 22:42 ` Patrick Mochel
2004-08-09 22:15 ` Nigel Cunningham
2004-08-10 0:43 ` Benjamin Herrenschmidt
2004-08-10 9:00 ` Russell King
2004-08-10 10:08 ` Pavel Machek
2004-08-10 0:40 ` Benjamin Herrenschmidt
2004-08-10 4:55 ` Patrick Mochel
2004-08-10 6:52 ` Benjamin Herrenschmidt [this message]
2004-08-10 10:07 ` Pavel Machek
2004-08-10 14:28 ` Patrick Mochel
2004-08-10 17:56 ` Pavel Machek
2004-08-10 22:41 ` Patrick Mochel
2004-08-10 23:10 ` Pavel Machek
2004-08-10 23:14 ` [patch] Smaller goal first: fix confusion [was Re: [RFC] Fix Device Power Management States] Pavel Machek
2004-08-11 1:02 ` [RFC] Fix Device Power Management States Benjamin Herrenschmidt
2004-08-10 19:41 ` David Brownell
2004-08-10 22:44 ` Patrick Mochel
2004-08-10 10:33 ` Matthew Garrett
2004-08-10 14:36 ` Patrick Mochel
2004-08-10 19:18 ` David Brownell
2004-08-10 20:50 ` Pavel Machek
2004-08-11 1:47 ` Todd Poynor
2004-08-12 22:03 ` Russell King
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=1092120750.14102.95.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.org \
--cc=pavel@ucw.cz \
/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 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.