lkml.org 
[lkml]   [2010]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] PM: Avoid losing wakeup events during suspend
On Mon, 21 Jun 2010 12:54:44 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Mon, 21 Jun 2010, Florian Mickler wrote:
>
> > > > > What happens if an event arrives just before you read
> > > > > /sys/power/wakeup_count, but the userspace consumer doesn't realize
> > > > > there is a new unprocessed event until after the power manager checks
> > > > > it?
> > >
> > > > I think this is not the kernel's problem. In this approach the kernel makes it
> > > > possible for the user space to avoid the race. Whether or not the user space
> > > > will use this opportunity is a different matter.
> > >
> > > It is _not_ possible for userspace to avoid this race. Help from the
> > > kernel is needed.
> >
> > It is possible if every (relevant) userspace program implements a
> > callback for the powermanager to check if one of it's wakeup-sources
> > got activated.
> >
> > That way the powermanager would read /sys/power/wakeup_count, then do
> > the roundtrip to all it's registered users and only then suspend.
>
> After further thought, there's still a race:

Ah, yes. That's what I meant in my other mail with 'how to determine
that an wake event is in flight'.

Read this too late.

> Alan Stern

Cheers,
Flo


\
 
 \ /
  Last update: 2010-06-21 22:43    [from the cache]
©2003-2011 Jasper Spaans