From: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
To: Patrick Mochel
<mochel-og82NyAXoxR0I81aPRRTmR2eb7JE58TQ@public.gmane.org>
Cc: Linux-pm mailing list <linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: Nested suspends; messages vs. states
Date: Thu, 24 Mar 2005 13:29:34 +1100 [thread overview]
Message-ID: <1111631375.16201.172.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.50.0503231742090.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 4689 bytes --]
> Are the leaf devices ever going to enter some random, ill-defined state?
> While a device could enter a number of states, that set seems finite.
> Correct me if I'm wrong, I only know PM from a PCI perpsective.
>
> For PCI, there are 4 possible states a device could be in (ok 5, counting
> D3-cold). How many power states are there in USB?
Power states of a device go far beyond what their bus provide. For
example, I have ideas of using that to provide a way for radeonfb to
underclock the video chip, with significant gain on power consumptions.
There may be plenty other operational modes on a given piece of HW that
aren't necesarily related to the PCI PM state. The later is just a
"tool" for use by the driver, they aren't really useful to expose in
practice.
> It would be trivial to add a set of lists to each bridge driver to hold
> each device that is in a particular state. E.g. for PCI that would be:
>
> struct list_head devices_d0;
> struct list_head devices_d1;
> struct list_head devices_d2;
> struct list_head devices_d3;
> struct list_head devices_d3cold;
But they make no sense ! Have you any driver writing experience ? :)
Specs are nice, but sometimes quite far from reality. Those states
aren't even properly defined by the PCI Spec (their actual HW meaning is
not), and what state to enter for a given state and what is the effect
of that state is totally device dependant. Some devices support only a
subset of them, etc etc etc...
> As devices are discovered and bound, they are put on the devices_d0 list.
> As runtime power management happens, they would be moved to the
> appropriate lists based on the power state they entered. When a bridge was
> told to go into a certain power state, it could easily iterate over all
> the devices that were only in a power state that had to change.
No, we shouldn't even care about the PCI PM states IMHO. Drivers may
chose to put their device in a given PCI PM state because they know that
on such HW, that PM state has this specific effect etc... but that's not
something we want to expose beyond that. There _is_ some platform
requirements on PCI PM states for sustem suspend though, and we need a
way to address them (via pci_choose_state or equivalent maybe) but that
isn't even always properly dealt with by all HW anyway.
>It would be trivial for a bus to do automatic opportunistic power
> management. It could quickly check what was the lowest state it could
> enter based on the highest power state a child could have:
>
> if (list_empty(&devices_d0)) {
> if (list_empty(&devices_d1)) {
> if (list_empty(&devices_d2)) {
> enter_b3();
> } else {
> enter_b2();
> }
> } else {
> enter_b1();
> }
> }
>
> Or something like that. :)
Excepot that there is nothing like a definition of what a "D2" state
means to a PCI bus ... If it meant "unclocked" (which is _usually_ the
case with some devices, assuming D2 means you can remove the clock but
not power), but it's not even properly specified.
> I agree, and it's easy enough to think of things with a bus-centric view.
> But, how does that add complexity to the core? I envision the core doing
> something like this:
>
> - Keep a hierarchical list of buses
> - Iterate over buses to put them to sleep
The core should only care about devices. A bus is just a special case of
device with childs... and thus a possible dependency. States exposed by
busses are device states. PCI cannot really expose any since the PCI D
states don't really have any meaning. The only thing PCI can expose with
some useful sanity is "clocked removed" and "power removed" ... There
may be room for a "low power" (only the minimum sleep power is
provided). Drivers could act on those, since those are states that
actually _mean_ something to the HW, thus drivers designers could take
proper decisions on what to do. At the bus level, D1 or D2 have no
meaning. The PCI spec is broken in this regard (and many others ...)
> If we kept it at that, we could just call down to the bridge drivers and
> have them iterate over the devices on their bus to suspend them. This
> would push all the handling of leaf devices to the bus subsystems
> themselves. That would keep the core simple, not matter to the leaf device
> drivers, and place the burden on the bridge drivers.
>
> The bridge driver largely don't exist (except for USB hubs), the
> requirements aren't very tough, and it would localize the semantics where
> they need to be - in the bus subsystems.
>
> Seems like a win all around..
>
> Ok, now I'll read the rest of the threads..
>
>
> Pat
--
Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2005-03-24 2:29 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-21 20:11 Nested suspends; messages vs. states Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503211436020.1241-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-21 20:20 ` Pavel Machek
[not found] ` <20050321202016.GI1390-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-21 21:14 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503211613010.2329-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-21 22:26 ` Pavel Machek
[not found] ` <20050321222609.GK1390-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-22 3:08 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503212140450.28689-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2005-03-22 11:08 ` Pavel Machek
[not found] ` <20050322110802.GA1751-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-22 17:24 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503221216430.954-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-23 23:49 ` Benjamin Herrenschmidt
2005-03-23 18:32 ` David Brownell
[not found] ` <200503231032.36164.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-23 21:00 ` Pavel Machek
2005-03-22 4:21 ` Benjamin Herrenschmidt
2005-03-22 17:04 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503221143460.954-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-22 23:36 ` Benjamin Herrenschmidt
2005-03-23 1:17 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503221709080.16154-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-23 19:02 ` David Brownell
[not found] ` <200503231102.27137.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-23 20:36 ` Nigel Cunningham
2005-03-23 21:08 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503231544550.631-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-24 2:35 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231827310.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 17:03 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0503241149000.1345-100000-3WpdWqXrU/qjv4eRiOYp3g@public.gmane.org>
2005-03-24 17:13 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240904570.13683-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 17:46 ` David Brownell
2005-03-24 17:51 ` Patrick Mochel
2005-03-24 19:27 ` Alan Stern
2005-03-23 18:58 ` David Brownell
[not found] ` <200503231058.54311.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-23 19:37 ` Jordan Crouse
[not found] ` <20050323123725.201d8a67-aftB2sG12IhaqnLngUycEA@public.gmane.org>
2005-03-24 5:16 ` David Brownell
2005-03-23 23:24 ` Benjamin Herrenschmidt
2005-03-24 2:45 ` David Brownell
[not found] ` <200503231845.55392.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 5:03 ` Benjamin Herrenschmidt
2005-03-24 5:27 ` David Brownell
[not found] ` <200503232127.19576.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 6:02 ` Benjamin Herrenschmidt
2005-03-24 6:31 ` David Brownell
[not found] ` <200503232231.00561.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 6:36 ` Benjamin Herrenschmidt
2005-03-24 7:46 ` David Brownell
2005-03-23 0:52 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503221635130.16154-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-23 1:21 ` Benjamin Herrenschmidt
2005-03-23 1:46 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503221724550.16154-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-23 3:31 ` Benjamin Herrenschmidt
2005-03-23 18:20 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231008340.17099-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-23 21:02 ` Pavel Machek
[not found] ` <20050323210204.GE30704-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-23 21:35 ` Nigel Cunningham
[not found] ` <1111613750.14853.117.camel-r49W/1Cwd2ff0s6lnCXPX/uOuaPYTxhvJwvTLr3MMZM@public.gmane.org>
2005-03-23 21:54 ` Pavel Machek
[not found] ` <20050323215416.GK30704-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-24 2:40 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231838570.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 3:16 ` Nigel Cunningham
[not found] ` <1111634182.3430.1.camel-r49W/1Cwd2ff0s6lnCXPX/uOuaPYTxhvJwvTLr3MMZM@public.gmane.org>
2005-03-24 8:19 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240017460.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 10:01 ` CPU local things [was Re: Nested suspends; messages vs. states] Pavel Machek
[not found] ` <20050324100153.GE1354-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-24 15:59 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240749030.24692-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 17:14 ` Nathan Lynch
2005-03-24 20:59 ` Nigel Cunningham
2005-03-23 23:14 ` Nested suspends; messages vs. states Benjamin Herrenschmidt
2005-03-24 1:27 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231724100.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 9:59 ` Pavel Machek
[not found] ` <20050324095910.GD1354-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-03-24 15:48 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240746290.24692-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 16:38 ` David Brownell
[not found] ` <200503240838.37628.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 17:00 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240858200.13683-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 17:33 ` David Brownell
[not found] ` <200503240933.49123.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 17:41 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503240937150.13683-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 18:08 ` David Brownell
2005-03-24 1:41 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231727220.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 2:22 ` Benjamin Herrenschmidt
2005-03-24 2:05 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231742090.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 2:29 ` Benjamin Herrenschmidt [this message]
2005-03-24 5:02 ` David Brownell
[not found] ` <200503232102.51132.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-24 5:14 ` Benjamin Herrenschmidt
2005-03-24 5:31 ` David Brownell
2005-03-24 8:16 ` Patrick Mochel
2005-03-23 19:06 ` David Brownell
[not found] ` <200503231106.03160.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2005-03-23 20:29 ` Nigel Cunningham
[not found] ` <1111609769.14853.104.camel-r49W/1Cwd2ff0s6lnCXPX/uOuaPYTxhvJwvTLr3MMZM@public.gmane.org>
2005-03-23 20:55 ` David Brownell
2005-03-23 21:18 ` Alan Stern
2005-03-24 2:13 ` Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503231810400.15119-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-24 2:52 ` 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=1111631375.16201.172.camel@gaston \
--to=benh-xvmvhmargas8u2djnn8i7kb+6bgklq7r@public.gmane.org \
--cc=linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=mochel-og82NyAXoxR0I81aPRRTmR2eb7JE58TQ@public.gmane.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