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 09:15:33 -0700 [thread overview]
Message-ID: <200410110915.33331.david-b@pacbell.net> (raw)
In-Reply-To: <1097470524.3249.34.camel@gaston>
On Sunday 10 October 2004 9:55 pm, Benjamin Herrenschmidt wrote:
>
> Well... it doesn't work on paul's laptop, but anyway, ok, let's go for
> the struct thing and forget about this for 2.6.9.
PM hasn't worked for me on 2.6 with most hardware, about since
the "new PMcore" kicked in, so it's hard for me to judge progress
except at the level of unit tests. Where I see two steps forward,
one step back ... on a good day.
The root cause of many of these problem is that there's
a confusion between system-wide sleep states and the
device-specific power states from which they're built.
They _should_ be using two distinct data types. Not one
integer/enum type ... especially not one int/enum type
that's got multiple conflicting "legacy" interpretations!
Something else to remember: the design center should
be (or at least include!) "partially suspended" systems,
where most hardware is in a low power mode unless it's
needed. That's not something the current PM framework
does well; it gets confused on system suspend later on,
if it finds devices it didnt' suspend.
> Now paul and I are trying to figure out what to put in that struct and
> what kind of information actually make any sense. It's not trivial. We
> have to deal with several things.
In USB-land, we've identified a need for a state name. Each different
bus can have different states, and device-specific power states are
also common. Sysfs should show those device-specific states.
Doesn't seem like anything else is needed ... so long as the power
management interactions get (re)factored sanely! However, each
bus or device could use container_of() to access any additional state
information ... including linkage to other hardware, or for PCI the
actual number of the state.
> We have the system state (cause of the request if you prefer),
The system state shouldn't matter to a device-specific suspend
routine ... AT ALL.
I like the model that what gets passed to drivers is more of a
local policy update than anything else. Within the bounds of
that policy, the driver can pick many device power states.
When the system is going to power itself off, it can pass a
device power policy that's rather inflexible.
> that is
> "idle" (we mostly don't implement that one yet but it's useful to make
> "room" for it, handhelds wants that badly),
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.
Drivers can be "idle" without entering low power states, and can
use wakeup events to enter/exit low power states without being
fully idle. (Hardware allowing.) That's an example of a policy that
drivers should be able to choose without affecting PMcore.
I've sent separate posts about how to add wakeup support to the
PM framework ... that omission should have been a great big
red (or is it chartreuse?) warning flag that the PM framework was
lacking some very basic functionality.
> "suspend to ram" and "suspend to disk".
Those aren't device power states at all!! They're system sleep
states (or transitions). And by the way, "suspend to disk" is
an odd model for systems without disks, or swap ... which oddly
enough tend to be ones that really need good PM, and which
(like HH.org) need the "partially suspended" system model
to work well.
> But what about user /sysfs originated requests ? (that is random numbers
> the user whacks in /sys/devices/...../power) what are their semantics ?
Sysfs should only read/write the names of the states that particular
device can support. Plus probably some generic requests for policies
that the sleep framework would hand to individual drivers.
> Also, do we carry around a "suggested" D state for what it means ? it's
> really an obscure PCI concept. However, as you can see with the hacks
> in drivers like radeonfb, ....
I can't think of PCI D-states as obscure, they're the core of its PM support.
PCI drivers need to use them to implement power policies.
Without looking at that code, I'll just say that while many PCI drivers
can probably offload the decision making to some PCI core code
("use D1 or D2 when idle if available; D3hot otherwise"), not all
can do that.
> > The more the merrier. Care to come up with a solution of your own?
> >
> > And no, I'm not interested in the type "let's fix one driver" kind of
> > thing. That's what we've had for the last year or more, and the fact is,
> > my laptop _never_ suspended during that time. So I really think it needs a
> > _proper_ solution.
>
> Agreed.
Right, and let's not make something that only works for PC-class hardware
or only for system-wide suspend operations ...
- Dave
next prev parent reply other threads:[~2004-10-11 16:19 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 [this message]
2004-10-11 22:22 ` Benjamin Herrenschmidt
2004-10-12 2:46 ` David Brownell
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=200410110915.33331.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