From: David Brownell <david-b@pacbell.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Oliver Neukum <oliver@neukum.org>, Pavel Machek <pavel@suse.cz>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Patrick Mochel <mochel@digitalimplant.org>
Subject: Re: Solving suspend-level confusion
Date: Tue, 3 Aug 2004 19:28:08 -0700 [thread overview]
Message-ID: <200408031928.08475.david-b@pacbell.net> (raw)
In-Reply-To: <1091493486.7396.92.camel@gaston>
On Monday 02 August 2004 17:38, Benjamin Herrenschmidt wrote:
> Nope. I don't think it makes sense to have the caller understand
> anything about D states. And their actual impact on hardware tend
> to depends from one chip to another too...
Even if you don't think that, it's what the current PCI drivers are
expecting. You're arguing to change about a dozen in-tree drivers
(doable), and some unknown number of others. When I do changes
like that, I _really_ like to change the argument type enough to make
the compiler start reporting broken drivers!
Maybe rather than changing from values 0-4 into values 0-3, it
should change into string constants naming the states ... if you don't
like typed struct pointers for such things!
> What we need to pass to drivers are policies. Right now, we defined
> suspend-to-ram and suspend-to-disk system wide policies, we may want
> to define some additional ones especially those that can be triggered
> by userspace to individual drivers.
/sys/power/state defines also "standby"; these are the PM_SUSPEND_*
enumeration values (other than "on").
But the /sys/bus/*/devices/*/power/state files just read and write numbers.
Those get sent to individual drivers. Passing (and printing) symbols
would make it more obvious what's going on there. It'd be good if those
symbols could include bus-specific state names (driver-specific?), as
well as policies like "standby", "mem", and "disk".
> > Make that "3 different concepts": system suspend state too.
> > Or maybe "2" is right, since I think you've already said you
> > define the driver operating state as something that should
> > be invisible from outside. (So it's not what I described.)
>
> Well, system suspend state too, right, it defines the driver
> state we are asking for.
System state != driver state though. I'd agree that there
can be semi-generic policy names though, which various
software (ACPI, platform- or bus-specific code, even drivers)
could try mapping to hardware-specific states.
> I don't understand what you are talking about... in the case of
> usb-storage, it has scsi disk as it's child in the device tree,
> the child should get the suspend call first of course, and yes, I know
> the current sysfs semantics for userland-originated suspend are broken.
At one point I heard one of those issues described as "semantics are
bus-specific", but that's only part of it... :(
> Right now, we are trying to at least get the full system suspend
> working, we can work on fixing partial-tree suspend (which is what you
> want there) later.
The "partial tree suspend" works only for the degenerate
tree: every device in the system! Wakeup events also need
some more attention.
There's now some partial-tree code in CONFIG_USB_SUSPEND (for
developers only), but jumping from USB into the next level driver
(SCSI, video, etc) raises questions.
> > I don't think we need to add any abstractions, and don't see what your
> > concern is about "breaking" something (that's already broken). We
> > do however need to make the existing abstractions (and APIs) work.
>
> Yup, but I still consider that it's a non-sense to pass D states to
> driver suspend() callback ;)
Passing PM_SUSPEND_* values (0-3) instead of PCI power states (0-4),
as PCI drivers have previously expected, looks like it ought to be a
simplifying assumption. Simpler is often good ... though this makes
me suspect "too simple". Especially since it pushes policy choices
into device drivers (normally not good, except for quirks like "this
driver+hardware can't do D3, so let's use D2")..
- Dave
next prev parent reply other threads:[~2004-08-04 2:34 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-30 16:44 Solving suspend-level confusion Pavel Machek
2004-07-30 22:39 ` Benjamin Herrenschmidt
2004-07-30 23:06 ` Pavel Machek
2004-07-31 4:02 ` David Brownell
2004-07-31 4:36 ` Pavel Machek
2004-07-31 5:49 ` Benjamin Herrenschmidt
2004-07-31 14:23 ` David Brownell
2004-07-31 17:01 ` Oliver Neukum
2004-07-31 17:51 ` David Brownell
2004-08-01 0:41 ` David Brownell
2004-08-01 1:34 ` Benjamin Herrenschmidt
2004-08-02 16:38 ` David Brownell
2004-08-03 0:38 ` Benjamin Herrenschmidt
2004-08-04 2:28 ` David Brownell [this message]
2004-08-04 2:26 ` Nigel Cunningham
2004-08-04 2:53 ` Benjamin Herrenschmidt
2004-08-04 2:52 ` Nigel Cunningham
2004-08-04 4:14 ` Benjamin Herrenschmidt
2004-08-04 4:25 ` Nigel Cunningham
2004-08-04 4:52 ` Benjamin Herrenschmidt
2004-08-04 4:54 ` Nigel Cunningham
2004-08-04 5:03 ` Benjamin Herrenschmidt
2004-08-04 5:05 ` Nigel Cunningham
2004-08-05 10:05 ` Nigel Cunningham
2004-08-05 22:31 ` Nigel Cunningham
2004-08-06 0:39 ` Benjamin Herrenschmidt
2004-08-06 21:30 ` Pavel Machek
2004-08-06 21:29 ` Pavel Machek
2004-08-06 22:27 ` Benjamin Herrenschmidt
2004-08-06 22:37 ` Pavel Machek
2004-08-06 21:26 ` Pavel Machek
2004-08-05 1:29 ` David Brownell
2004-08-05 10:19 ` Nigel Cunningham
2004-08-06 0:32 ` David Brownell
[not found] ` <1091772799.2532.50.camel@laptop.cunninghams>
2004-08-07 22:24 ` David Brownell
2004-08-04 2:56 ` Benjamin Herrenschmidt
2004-08-04 3:30 ` David Brownell
2004-08-04 4:19 ` Benjamin Herrenschmidt
2004-08-04 4:47 ` What PM should be and do (Was Re: Solving suspend-level confusion) Nigel Cunningham
2004-08-04 4:53 ` Benjamin Herrenschmidt
2004-08-04 4:59 ` Nigel Cunningham
2004-08-08 16:54 ` Pavel Machek
2004-08-08 21:55 ` Nigel Cunningham
2004-08-09 8:42 ` Pavel Machek
2004-08-05 18:19 ` Greg KH
2004-08-05 22:14 ` Nigel Cunningham
2004-08-07 0:08 ` Éric Brunet
2004-08-08 19:48 ` Pavel Machek
2004-08-11 21:23 ` Greg KH
2004-08-08 0:54 ` David Brownell
2004-08-06 21:21 ` Solving suspend-level confusion Pavel Machek
2004-07-31 21:09 ` Benjamin Herrenschmidt
2004-08-02 16:40 ` David Brownell
2004-08-03 0:50 ` Benjamin Herrenschmidt
2004-08-07 23:30 ` David Brownell
2004-08-06 21:10 ` Pavel Machek
2004-08-07 23:23 ` David Brownell
2004-08-08 17:16 ` Pavel Machek
2004-08-06 20:04 ` Pavel Machek
2004-08-07 22:14 ` David Brownell
2004-08-07 23:53 ` Benjamin Herrenschmidt
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=200408031928.08475.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.org \
--cc=oliver@neukum.org \
--cc=pavel@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox