From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>, Daniel Drake <dsd@laptop.org>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Trying to understand new wakeup events architecture
Date: Thu, 13 Jan 2011 20:34:49 +0100 [thread overview]
Message-ID: <201101132034.49522.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1101131154350.2022-100000@iolanthe.rowland.org>
On Thursday, January 13, 2011, Alan Stern wrote:
> On Thu, 13 Jan 2011, Daniel Drake wrote:
>
> > On Thu, 2011-01-13 at 10:14 -0500, Alan Stern wrote:
> > > On Thu, 13 Jan 2011, Daniel Drake wrote:
> > >
> > > > As for contents, it will read back a string. One of:
> > > >
> > > > rtc alarm
> > > > power button
> > > > lid
> > > > key press
> > > > battery
> > > > battery state changed
> > > > battery error
> > > > ebook
> > > > wlan packet
> > > > ac power
> > > > battery critical
> > > > gp timer
> > > > hda
> > > > usb
> > > > unknown
> > >
> > > Wouldn't it be better to read back a device pathname when the wakeup
> > > source can be identified as a particular device? Whoever uses this
> > > field should be responsible for converting it to one of those more
> > > generic forms.
> >
> > It could be done, but might be ugly. The problem is that those
> > individual devices don't really know that they were woken up. It's done
> > by OLPC's EC driver. So the EC driver would have to either hardcode
> > device paths, or have a load of device-hunting code.
Alternatively, it could store the information somewhere and have some special
code down the resume code path turn it into the info available from sysfs.
> > Another small problem is that it doesn't encode the difference between
> > "battery state changed" and "battery error", for example.
> >
> > If it's really disliked as a string, perhaps it would be OK just to
> > stash it within the sysfs directory of our device, not polluting the
> > global namespace.
> >
> > I'm hoping this can all be a temporary measure anyway, as future closer
> > integration with Rafael's wakeup events architecture plus the ability
> > for that architecture to export wakeup source info should make it go
> > away.
Well, if that's supposed to be temporary, it shouldn't be there in
/sys/power/, so please put it somewhere else in that case.
> You can do whatever is best for you on the OLPC platform; I was just
> offering a suggestion.
It looks like Daniel wants the wakeup events framework to store the last
active wakeup source information somewhere (eg. in a file in /sys/power).
I'm a little bit worried about that, because potentially there may be many
wakeup events occuring at run time, in which case it would be a significant
performance overhead to update the "last active wakeup source" info every
time (and a scalability issue, because every code path handling a wakeup
source would want to update the same sysfs file). Also, collecting that
information at run time doesn't seem to be particularly useful.
It may be useful to know what device has actually woken up the system from
suspend. To that end, I think the only really valid approach is to retrieve
this information from the platform firmware early during resume and export
it through a sysfs attribute afterwards. We can develop a generic helper
code for that second part, but the first one has to be platform-specific.
Daniel, what exactly does your user space use this information for?
Thanks,
Rafael
next prev parent reply other threads:[~2011-01-13 19:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 17:57 Trying to understand new wakeup events architecture Daniel Drake
2010-12-15 22:33 ` Rafael J. Wysocki
2010-12-16 14:39 ` Daniel Drake
2011-01-12 15:01 ` Daniel Drake
2011-01-12 20:02 ` Rafael J. Wysocki
2011-01-13 15:06 ` Daniel Drake
2011-01-13 15:14 ` Alan Stern
2011-01-13 15:56 ` Daniel Drake
2011-01-13 16:55 ` Alan Stern
2011-01-13 19:34 ` Rafael J. Wysocki [this message]
2011-01-13 20:01 ` Daniel Drake
2011-01-13 20:31 ` Alan Stern
2011-01-13 20:41 ` Daniel Drake
2011-01-14 2:11 ` Paul Fox
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=201101132034.49522.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=dsd@laptop.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=stern@rowland.harvard.edu \
/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