lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201007022121.45640.rjw@sisk.pl>
Date:	Fri, 2 Jul 2010 21:21:45 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Pavel Machek <pavel@....cz>
Cc:	linux-pm@...ts.linux-foundation.org,
	Alan Stern <stern@...land.harvard.edu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Neil Brown <neilb@...e.de>,
	Matthew Garrett <mjg59@...f.ucam.org>,
	mark gross <640e9920@...il.com>,
	"Arve Hj??nnev??g" <arve@...roid.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Florian Mickler <florian@...kler.org>,
	linux-pci@...r.kernel.org, Jesse Barnes <jbarnes@...tuousgeek.org>
Subject: Re: [PATCH] PM: Make it possible to avoid wakeup events from being lost

On Friday, July 02, 2010, Pavel Machek wrote:
> On Thu 2010-07-01 21:02:27, Rafael J. Wysocki wrote:
> > On Thursday, July 01, 2010, Pavel Machek wrote:
> > > Hi!
> > > 
> > > > @@ -114,3 +114,17 @@ Description:
> > > >  		if this file contains "1", which is the default.  It may be
> > > >  		disabled by writing "0" to this file, in which case all devices
> > > >  		will be suspended and resumed synchronously.
> > > > +
> > > > +What:		/sys/power/wakeup_count
> > > > +Date:		July 2010
> > > > +Contact:	Rafael J. Wysocki <rjw@...k.pl>
> > > > +Description:
> > > > +		The /sys/power/wakeup_count file allows user space to avoid
> > > > +		losing wakeup events when transitioning the system into a sleep
> > > > +		state.  Reading from it returns the current number of registered
> > > > +		wakeup events and it blocks if some wakeup events are being
> > > > +		processed at the time the file is read from.  Writing to it
> > > > +		will only succeed if the current number of wakeup events is
> > > > +		equal to the written value and, if successful, will make the
> > > > +		kernel abort a subsequent transition to a sleep state if any
> > > > +		wakeup events are reported after the write has returned.
> > > 
> > > I assume that second suspend always succeeds?
> > 
> > The mechanism is one-shot if that's what you're asking for.
> 
> Yep, it would be nice to document it.
> 
> Plus maybe... should there be way to clear the wakeup_count? For
> example when userspace decides that battery is low and that it wants
> to go to sleep now?

You don't need to clear it, just don't write to it before writing to
/sys/power/state.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ