From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@digitalimplant.org>
Cc: linux-kernel@vger.kernel.org, benh@kernel.crashing.org,
david-b@pacbell.net
Subject: Re: [RFC] Fix Device Power Management States
Date: Mon, 9 Aug 2004 23:29:49 +0200 [thread overview]
Message-ID: <20040809212949.GA1120@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.50.0408090840560.16137-100000@monsoon.he.net>
Hi!
> Uh, not really. During suspend-to-disk, you would call
>
> device_stop();
> device_save();
> <snapshot system>
> class_device_start(suspend_device);
> <write snapshot>
> class_device_stop(suspend_device);
> device_power_down(state);
Ok, I can live with that.
> > Semantics of dev_stop is "may not do DMA and interrupts when stopped",
> > right?
>
> To be more precise, "device is not processing any transactions and will
> not be used to submit more to". It's up to the class to remove it from any
> queues, etc, so DMA never has a chance to begin.
Well, "no DMA" needs to be part of definition, too, because some
devices (USB) do DMA only if they have nothing to do.
> It's not too complex; it's simply that the driver core is the one
> responsible between mapping a system suspend state to the device suspend
> state, based on values that the driver knows a priori. If you push that
> responsibility down to the drivers, you require all of them to implement
> the same thing, causing code duplication, which means more
> copy-n-pasting,
...well, no, if device wants (for example) PCI state, it can call
to_pci_state() function from core. That should avoid code
duplication. OTOH if driver wants to do something more advanced, it
still can be done.
> and more of a chance to get it wrong. If we choose to do it once and right
> in the driver core, the resulting drivers become simpler, since they only
> have to respond to something that says "enter this power state, damnit"
>
> On the other hand, if it's too complicated for you, I encourage you to
> modify the patch or create a new one that solves all of the problems in a
> simpler manner.
Well, if runtime suspend is the goal, your patch reflects that
complexity.
> > I believe different state is needed for "quiesce for atomic copy" and
> > for "we are really going down to S4 now".
>
> There is nothing fundamentally different at the functional level - you
> don't want any devices fulfilling any request. Besides, by the time the
> system is actually ready to be placed in S4, the devices have long-since
> been stopped, and the class devices do not need another notification
> beyond "stop"
You are right, I was not reading carefully enough.
Anyway, there's still one problem:
if something like this gets merged, it will immediately break swsusp
because initially no drivers will have "stop" methods.
Passing system state down to drivers and having special "quiesce"
(as discussed in rather long thread) state has advantage of
automagicaly working on drivers that ignore u32 parameter of suspend
callback (and that's most of them). David's patches do not bring us
runtime suspend capabilities, but do not force us to go through all
the drivers, either...
You could perhaps make the code call suspend when no stop callback is
present... That should add a simple migration path... and would
probably work for me.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
next prev parent reply other threads:[~2004-08-09 21:33 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-09 10:43 Patrick Mochel
2004-08-09 11:38 ` Pavel Machek
2004-08-09 16:02 ` Patrick Mochel
2004-08-09 21:29 ` Pavel Machek [this message]
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
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=20040809212949.GA1120@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=benh@kernel.crashing.org \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.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
Powered by JetHome