public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Pavel Machek <pavel@ucw.cz>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: Totally broken PCI PM calls
Date: Mon, 11 Oct 2004 19:46:03 -0700	[thread overview]
Message-ID: <200410111946.03634.david-b@pacbell.net> (raw)
In-Reply-To: <1097533363.13795.22.camel@gaston>

On Monday 11 October 2004 3:22 pm, Benjamin Herrenschmidt wrote:
> On Tue, 2004-10-12 at 02:15, David Brownell wrote:
> 
> > In USB-land, we've been discussing "idle" as something orthogonal
> > to the PM states.  Not clear on all the details yet, but I'd vote against
> > anything that tries to make "driver doing nothing" a power state,
> > or doesn't have a way to idle drivers.
> 
> Well, having an "idle" system state that asks all drivers to go to
> "idle" state doesn't prevent local bus/driver management from having
> it's own dynamic idle state ...

Right ... if it were a CPU, one could say it's the difference between
a default "performance" governor or instead "ondemand".  But
it's an single device; so we can't currently say such things.

 
> "idle" as a system state is a kind of "light sleep" state where you come
> back up very quickly and makes a lot of sense for handheld devices.
> 
> "idle" as a device-state is what suspend-to-disk really wants :)

Some of those handheld devices want the analogue of an
"ondemand" governor applied to each device.  On a truly
idle system, that should end up looking like an "idle" system
state ... except that it wakes as needed!

 
> So you don't wnat the system state passed down to drivers but a policy
> instead ... We probably need more than that, like some additional flags
> along with a platform filter. For example, during a system suspend, a
> given piece of HW may end up beeing unclocked or powered off by the
> system, the driver will want to know that. The firmware may reboot the
> device on wakeup or not. The driver need to know that too.

Right; losing one clock may just save power, but losing another might
force a reset.  But most of that would be the driver's knowledge of how
the system was built ... more common with SOC systems than with PCs,
and a general PM core issue not a PCI-only one.

For PCI,  the drivers are often going to stick to the basics:  if it's really
in a D3hot, D2, or D1 state then it's still powered and didn't need to
lose any state.  Simple drivers might always do another reset.  More
complex ones (like a USB HCD!) will avoid that because of evil
consequences.


> But I agree that we can avoid passing down a system state if we define
> a "policy" state along with a few flags.
> 
> There is something else that we need to take into account. For system
> state, we want the driver to stay idle until woken up explicitely. But
> there are also more "dynamic" PM states that we may want to be triggered
> by the user via sysfs for which the driver will come back automatically
> when a request comes in from upstream (equivalent to disk idle sleep).

Yes, in fact what you talked about as a "system idle" state seems
like it might be a per-device version of your "dynamic device idle" state,
but with wakeup events globally disabled.  (And maybe also automatic
power state transitions disabled...)

Or I suppose "idle" could just be another kind of device policy
governor, along with "performance" and "ondemand".


> They are, but the choice of a device power state from a system power
> state can most of the time only be done ... by the device-driver itself,
> eventually with support from the platform. Only the device-driver knows
> what it's device really supports as far as states as concerned, what the
> driver supports waking the device from, etc... Though it needs
> informations and help from the platform as well, like knowing if the
> firmware will bring the device back up from power-on-reset (this is very
> important for video cards).

Sure, though PCI is standardized enough that many non-video drivers
can have very simple suspend/resume logic (as I sketched above).
The framework needs to handle those well, too!



> The problem, again, is that chosing the right state is a decision that
> can only be done by the driver, provided it knows information about the
> system state (or policy if you prefer, your policy thing is just a way
> to pass system states without calling them this way),

It's not "just" that.  Consider N devices that can each be made to use
one of three policies:  performance, ondemand, or idle.   Clearly
there are more than 3N potential system states!   Though I suppose
it all comes down to what a "state" is.  It'd certainly make sense to
make it easy to set all devices to use the same policy; also, to let
userspace manage the states of particular devices.


> and informations 
> from the platform about what will actually happen on this specific slot
> after the state is entered (and a lot of systems don't give a shit about
> PCI D states at this point, some machines will just power down all
> slots, or a random set of them, some will cut clocks off, some will do
> nothing, etc...) 

Well that sounds like no fun!  But it's not all that different from how
various non-PCI systems work either.

- Dave

  reply	other threads:[~2004-10-12  3:03 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-11  0:45 Totally broken PCI PM calls Benjamin Herrenschmidt
2004-10-11  2:41 ` Linus Torvalds
2004-10-11  3:42   ` Paul Mackerras
2004-10-11  4:04     ` Linus Torvalds
2004-10-11  4:24       ` Paul Mackerras
2004-10-11  9:57         ` Pavel Machek
2004-10-11 14:42         ` Linus Torvalds
2004-10-11 14:56           ` suspend-to-RAM [was Re: Totally broken PCI PM calls] Pavel Machek
2004-10-11 15:30             ` Linus Torvalds
2004-10-11 17:39               ` Olivier Galibert
2004-10-11 18:21                 ` Pavel Machek
2004-10-11 15:53             ` Brice Goglin
2004-10-11 16:17               ` Pavel Machek
2004-10-11 17:09                 ` Brice Goglin
2004-10-11 18:23                   ` Pavel Machek
2004-10-11 18:40                     ` Brice Goglin
2004-10-11 16:47         ` Totally broken PCI PM calls David Brownell
2004-10-11 22:28           ` Benjamin Herrenschmidt
2004-10-11 22:58             ` Dmitry Torokhov
2004-10-11 23:08               ` Benjamin Herrenschmidt
2004-10-12  3:00                 ` David Brownell
2004-10-12  4:09                   ` Dmitry Torokhov
2004-10-12 16:56                     ` David Brownell
2004-10-12  9:27             ` Russell King
2004-10-12 11:24               ` Benjamin Herrenschmidt
2004-10-11  4:25     ` Linus Torvalds
2004-10-11 10:18       ` Pavel Machek
2004-10-11 10:54         ` Benjamin Herrenschmidt
2004-10-11 16:01         ` Linus Torvalds
2004-10-15 13:59           ` Pavel Machek
2004-10-15 15:56             ` Linus Torvalds
2004-10-24 20:58               ` Pavel Machek
2004-10-24 21:18                 ` Linus Torvalds
2004-10-11 16:36     ` David Brownell
2004-10-11 21:17       ` Nigel Cunningham
2004-10-11 21:37         ` David Brownell
2004-10-11 22:12           ` Stefan Seyfried
2004-10-12  2:59             ` David Brownell
2004-10-12  8:54               ` Pavel Machek
2004-10-12 10:32                 ` Stefan Seyfried
2004-10-12 18:28                 ` David Brownell
2004-10-12 20:28                   ` Stefan Seyfried
2004-10-13 13:34                     ` David Brownell
2004-10-12  1:24           ` Nigel Cunningham
2004-10-12  8:53           ` Pavel Machek
2004-10-12 18:52             ` David Brownell
2004-10-12 19:50               ` Pavel Machek
2004-10-12 22:13               ` Benjamin Herrenschmidt
2004-10-12 22:35                 ` David Brownell
2004-10-11 22:26       ` Benjamin Herrenschmidt
2004-10-11  3:45   ` Benjamin Herrenschmidt
2004-10-11  4:08     ` Linus Torvalds
2004-10-11  4:23       ` Benjamin Herrenschmidt
2004-10-11  4:32         ` Linus Torvalds
2004-10-11  4:55           ` Benjamin Herrenschmidt
2004-10-11 16:15             ` David Brownell
2004-10-11 22:22               ` Benjamin Herrenschmidt
2004-10-12  2:46                 ` David Brownell [this message]
2004-10-12  4:02                   ` Benjamin Herrenschmidt
2004-10-12 10:49                     ` Nigel Cunningham
2004-10-12 11:27                       ` Benjamin Herrenschmidt
2004-10-12 11:38                         ` Nigel Cunningham
2004-10-12 11:51               ` Pavel Machek
2004-10-11 10:08     ` Pavel Machek
2004-10-11  9:51 ` 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=200410111946.03634.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=pavel@ucw.cz \
    --cc=torvalds@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