From: John Fremlin <chief@bandits.org>
To: "Acpi-PM (E-mail)"
<linux-power@phobos.fachschaften.tu-muenchen.de>,
<linux-kernel@vger.kernel.org>
Subject: Next gen PM interface
Date: 19 Apr 2001 04:54:56 +0100 [thread overview]
Message-ID: <m2d7a97ddb.fsf_-_@bandits.org> (raw)
In-Reply-To: <4148FEAAD879D311AC5700A0C969E89006CDDD91@orsmsx35.jf.intel.com> <m2oftvkm6f.fsf@boreas.yi.org.>
In-Reply-To: <m2oftvkm6f.fsf@boreas.yi.org.>
John Fremlin <chief@bandits.org> writes:
[...]
> IMHO the pm interface should be split up as following:
Nobody has disagreed: therefore this separation must be perfect ;-)
> (1) Battery status, power status, UPS status polling. It
> should be possible for lots of processes to do this
> simultaneously. [That does not prohibit a single process
> querying the kernel and all the others querying it.]
Solution. Have a bunch of procfs or dev nodes each giving info on a
particular power source, like now, but vaguely standardise the output.
> (2) Funky events happening to the physical machine, like a
> button being pressed, the case being closed, etc. [Should this
> include battery low warnings, power status changes? I don't
> know.]
Solution. Have a special procfs or dev node that any number of people
can select(2) or read(2). Protocol text. Syntax:
<event> <WS> <subsystem> <WS> <description> <LF>
Where <event> is one of the strings
OFF,SLEEP,WAKE,EMERGENCY,POWERCHANGE, <WS> is a space character,
<subsystem> is a word signifying the kernel pm interface responsible
for generating th event, <description> is an arbitrary string. <LF> is
a newline character \n.
This is flexible and simple. It means a reasonable default behaviour
can be suggested by the kernel (OFF,SLEEP,etc.) for events that
userspace doesn't know about and yet userspace can choose fine grained
policy and provide helpful error messages based on the exact event by
checking the description.
[...]
> (3) Sending the machine to sleep, turning it off. It should be
> possible to do this from userspace ;-)
I would suggest that all pm capable objects should be able to be
controlled individually. E.g. you should be able to send your monitor
to sleep alone, leaving other stuff running. Fbdrivers are already
capable of this on some archs.
IOW I suggest a nice FS with a dir per PM capable device. In this
dir would be
name - descriptive text name of device class
wake - writing to this node wakes device
sleep - writing a number n (text encoded) sends the device to
sleep in such a way that it can be back in action in no less
than n seconds after a wakeup call on a vague guess
basis. Reading from it gets errno.
off - writing to this node puts device in deepest possible
sleep, possibly losing state. Reading gets errno.
Like the proc/sys/net/ipv4/neigh stuff you can have an all/ dir that'd
try to whatever to everything. Hotunplug can be handled.
Any objections? Would such a patch be accepted by the powers that be?
[...]
--
http://www.penguinpowered.com/~vii
next prev parent reply other threads:[~2001-04-19 3:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-18 0:07 Let init know user wants to shutdown Grover, Andrew
2001-04-18 0:51 ` Alan Cox
2001-04-18 1:56 ` John Fremlin
2001-04-18 11:55 ` Alan Cox
2001-04-18 19:10 ` John Fremlin
2001-04-18 20:10 ` Alan Cox
2001-04-18 20:21 ` John Fremlin
2001-04-18 21:05 ` Avery Pennarun
2001-04-18 21:34 ` John Fremlin
2001-04-20 17:02 ` Pavel Machek
2001-05-02 16:52 ` John Fremlin
2001-04-20 17:01 ` Pavel Machek
2001-04-20 23:41 ` John Fremlin
2001-04-21 7:54 ` Pavel Machek
2001-04-24 0:17 ` Jamie Lokier
2001-04-24 1:08 ` John Fremlin
2001-04-24 10:06 ` Pavel Machek
2001-04-25 14:28 ` Jamie Lokier
2001-04-25 16:11 ` Richard Gooch
2001-04-18 1:54 ` John Fremlin
2001-04-19 3:54 ` John Fremlin [this message]
2001-04-19 4:07 ` Next gen PM interface Alan Cox
2001-04-19 5:08 ` Patrick Mochel
2001-04-19 18:57 ` John Fremlin
2001-04-19 19:09 ` Patrick Mochel
2001-04-19 19:30 ` John Fremlin
2001-04-19 19:07 ` John Fremlin
2001-04-20 17:08 ` 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=m2d7a97ddb.fsf_-_@bandits.org \
--to=chief@bandits.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-power@phobos.fachschaften.tu-muenchen.de \
/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