From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Daniel Drake <dsd@laptop.org>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Trying to understand new wakeup events architecture
Date: Wed, 15 Dec 2010 23:33:43 +0100 [thread overview]
Message-ID: <201012152333.43644.rjw@sisk.pl> (raw)
In-Reply-To: <AANLkTik0y2O4GTvoFkm-94iSWdWUG8juZ0cBNWXDas8Q@mail.gmail.com>
On Tuesday, December 14, 2010, Daniel Drake wrote:
> Hi,
>
> The OLPC XO laptop suspends a lot. It suspends with the screen on as
> if it is still running. It can be woken up in a variety of ways:
> keyboard, mouse, WLAN, ...
>
> While upstreaming OLPC's power management code I'm facing the
> requirement that our userspace power manager needs to know the reason
> for system wakeup. For example, if it was a WLAN packet then we can go
> back to sleep pretty quickly, without restoring screen brightness (the
> screen gets dimmed after a few mins of inactivity on the
> keyboard/mouse front). But if the system was woken up with the
> keyboard we want to restore screen brightness immediately and stay
> awake for a longer time before going back into suspend.
>
> We used to do this (outside of mainline) with a /proc node storing the
> "wakeup reason" but I'm now wondering what the most upstream-suitable
> approach is.
>
> I saw this patch:
>
> commit 074037ec79bea73edf1b1ec72fef1010e83e3cc5
> Author: Rafael J. Wysocki <rjw@sisk.pl>
> Date: Wed Sep 22 22:09:10 2010 +0200
>
> PM / Wakeup: Introduce wakeup source objects and event statistics
>
> But I'm unable to find any documentation of what it's for or how to use it.
>
> Does it solve my problem?
> If so, are there any examples of drivers adapted to use this
> functionality? Or documentation?
>
> I suspect the reason I don't understand it well is because I haven't
> read 17 long threads about android...And I'd rather not, if it can be
> avoided :)
I guess it's sufficient to read the article at http://lwn.net/Articles/416690/
(or the PDF linked from there is that's not enough :-)).
I don't really think it solves your problem right now, because it's only a
high-level framework and it's missing some mechanics for this purpose.
In principle you could compare device wakeup counters before suspend
and after resume and figure out what devices reported wakeup in the
meantime from that. For devices, the counters may be read from sysfs.
For "raw" wakeup sources it's necessary to read the wakeup_sources file in
debugfs.
Still, you need your subsystems to call pm_wakeup_event() or pm_stay_awake()
during resume to actually report the events.
Thanks,
Rafael
next prev parent reply other threads:[~2010-12-15 22:33 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 [this message]
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
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=201012152333.43644.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=dsd@laptop.org \
--cc=linux-pm@lists.linux-foundation.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