From: mark gross <640e9920@gmail.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: markgross@thegnar.org, linux-pm@lists.linux-foundation.org,
"Alan Stern" <stern@rowland.harvard.edu>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Neil Brown" <neilb@suse.de>,
"Matthew Garrett" <mjg59@srcf.ucam.org>,
"mark gross" <640e9920@gmail.com>,
"Arve Hjønnevåg" <arve@android.com>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Florian Mickler" <florian@mickler.org>,
linux-pci@vger.kernel.org,
"Jesse Barnes" <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH] PM: Make it possible to avoid wakeup events from being lost
Date: Mon, 28 Jun 2010 21:43:32 -0700 [thread overview]
Message-ID: <20100629044332.GD6250@gvim.org> (raw)
In-Reply-To: <201006281450.11285.rjw@sisk.pl>
On Mon, Jun 28, 2010 at 02:50:10PM +0200, Rafael J. Wysocki wrote:
> On Monday, June 28, 2010, mark gross wrote:
> > Looks good to me!
>
> Great, thanks! May I add your "Acked-by" to the patch, then?
yes.
Acked-by: markgross <markgross@thegnar.org>
--mgross
> Rafael
>
>
> > On Sat, Jun 26, 2010 at 03:14:13PM +0200, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > >
> > > One of the arguments during the suspend blockers discussion was that
> > > the mainline kernel didn't contain any mechanisms making it possible
> > > to avoid losing wakeup events during system suspend.
> > >
> > > Generally, there are two problems in that area. First, if a wakeup
> > > event occurs exactly when /sys/power/state is being written to, it
> > > may be delivered to user space right before the freezer kicks in, so
> > > the user space consumer of the event may not be able to process it
> > > before the system is suspended. Second, if a wakeup event occurs
> > > after user space has been frozen, it is not generally guaranteed that
> > > the ongoing transition of the system into a sleep state will be
> > > aborted.
> > >
> > > To address these issues introduce a new global sysfs attribute,
> > > /sys/power/wakeup_count, associated with a running counter of wakeup
> > > events and three helper functions, pm_stay_awake(), pm_relax(), and
> > > pm_wakeup_event(), that may be used by kernel subsystems to control
> > > the behavior of this attribute and to request the PM core to abort
> > > system transitions into a sleep state already in progress.
> > >
> > > The /sys/power/wakeup_count file may be read from or written to by
> > > user space. Reads will always succeed (unless interrupted by a
> > > signal) and return the current value of the wakeup events counter.
> > > Writes, however, will only succeed if the written number is equal to
> > > the current value of the wakeup events counter. If a write is
> > > successful, it will cause the kernel to save the current value of the
> > > wakeup events counter and to abort the subsequent system transition
> > > into a sleep state if any wakeup events are reported after the write
> > > has returned.
> > >
> > > [The assumption is that before writing to /sys/power/state user space
> > > will first read from /sys/power/wakeup_count. Next, user space
> > > consumers of wakeup events will have a chance to acknowledge or
> > > veto the upcoming system transition to a sleep state. Finally, if
> > > the transition is allowed to proceed, /sys/power/wakeup_count will
> > > be written to and if that succeeds, /sys/power/state will be written
> > > to as well. Still, if any wakeup events are reported to the PM core
> > > by kernel subsystems after that point, the transition will be
> > > aborted.]
> > >
> > > Additionally, put a wakeup events counter into struct dev_pm_info and
> > > make these per-device wakeup event counters available via sysfs,
> > > so that it's possible to check the activity of various wakeup event
> > > sources within the kernel.
> > >
> > > To illustrate how subsystems can use pm_wakeup_event(), make the
> > > low-level PCI runtime PM wakeup-handling code use it.
> > >
> > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > > ---
next prev parent reply other threads:[~2010-06-29 4:43 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-26 13:14 [PATCH] PM: Make it possible to avoid wakeup events from being lost Rafael J. Wysocki
2010-06-27 15:50 ` Alan Stern
2010-06-27 15:50 ` Alan Stern
2010-06-27 23:59 ` Rafael J. Wysocki
2010-06-28 14:16 ` Alan Stern
2010-06-28 19:01 ` [update] " Rafael J. Wysocki
2010-06-28 19:11 ` Jesse Barnes
2010-06-28 19:11 ` Jesse Barnes
2010-06-28 19:19 ` Alan Stern
2010-06-28 21:19 ` Rafael J. Wysocki
2010-06-28 21:19 ` Rafael J. Wysocki
2010-06-28 19:19 ` Alan Stern
2010-06-28 20:38 ` Greg KH
2010-06-28 20:38 ` Greg KH
2010-06-30 7:10 ` Florian Mickler
2010-06-30 7:10 ` Florian Mickler
2010-06-30 13:47 ` mark gross
2010-06-30 13:47 ` mark gross
2010-06-30 18:00 ` Alan Stern
2010-06-30 19:27 ` Rafael J. Wysocki
2010-06-30 19:58 ` Alan Stern
2010-06-30 19:58 ` Alan Stern
2010-06-30 23:52 ` Rafael J. Wysocki
2010-06-30 23:52 ` Rafael J. Wysocki
2010-07-01 13:58 ` Alan Stern
2010-07-01 20:08 ` Rafael J. Wysocki
2010-07-01 20:44 ` Alan Stern
2010-07-01 20:44 ` Alan Stern
2010-07-01 21:05 ` Rafael J. Wysocki
2010-07-01 21:05 ` Rafael J. Wysocki
2010-07-01 20:08 ` Rafael J. Wysocki
2010-07-01 13:58 ` Alan Stern
2010-06-30 19:27 ` Rafael J. Wysocki
2010-06-30 18:00 ` Alan Stern
2010-06-28 19:01 ` Rafael J. Wysocki
2010-06-28 14:16 ` Alan Stern
2010-06-28 23:28 ` David Brownell
2010-06-28 23:28 ` [linux-pm] " David Brownell
2010-06-29 19:57 ` Alan Stern
2010-06-29 19:57 ` Alan Stern
2010-06-27 23:59 ` Rafael J. Wysocki
2010-06-27 22:28 ` mark gross
2010-06-27 22:28 ` mark gross
2010-06-28 12:50 ` Rafael J. Wysocki
2010-06-29 4:43 ` mark gross [this message]
2010-06-29 4:43 ` mark gross
2010-06-28 12:50 ` Rafael J. Wysocki
2010-07-01 13:32 ` Pavel Machek
2010-07-01 13:32 ` Pavel Machek
2010-07-01 15:08 ` Florian Mickler
2010-07-01 15:08 ` Florian Mickler
2010-07-01 19:02 ` Rafael J. Wysocki
2010-07-02 18:14 ` Pavel Machek
2010-07-02 19:21 ` Rafael J. Wysocki
2010-07-02 19:21 ` Rafael J. Wysocki
2010-07-02 18:14 ` Pavel Machek
2010-07-01 19:02 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2010-06-27 2:43 [linux-pm] " David Brownell
2010-06-27 3:06 ` Alan Stern
2010-06-26 18:21 [linux-pm] " Rafael J. Wysocki
2010-06-26 19:58 ` Alan Stern
2010-06-26 17:14 [linux-pm] " Alan Stern
2010-06-26 18:21 ` Rafael J. Wysocki
2010-06-27 2:43 ` David Brownell
2010-06-26 16:54 [linux-pm] " David Brownell
2010-06-26 17:14 ` Alan Stern
2010-06-26 18:20 ` Rafael J. Wysocki
2010-06-26 16:54 David Brownell
2010-06-26 13:14 Rafael J. Wysocki
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=20100629044332.GD6250@gvim.org \
--to=640e9920@gmail.com \
--cc=arve@android.com \
--cc=dmitry.torokhov@gmail.com \
--cc=florian@mickler.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=markgross@thegnar.org \
--cc=mjg59@srcf.ucam.org \
--cc=neilb@suse.de \
--cc=rjw@sisk.pl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.