lkml.org 
[lkml]   [2009]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFD] Automatic suspend
Date
On Friday 27 February 2009, Matthew Garrett wrote:
> On Fri, Feb 27, 2009 at 03:22:39PM +0100, Rafael J. Wysocki wrote:
> > On Friday 27 February 2009, Pavel Machek wrote:
> > > Wakelocks done right are single atomic_t... and if you set it to 0,
> > > you just unblock "sleeper" thread or something. Zero polling and very
> > > simple...
> >
> > Except that you have to check all of the wakelocks periodically in a loop =>
> > polling. So?
>
> Why do you need to check them? If you're taking this approach you just
> have something like:
>
> suspend_unblock() {
> if (atomc_dec_and_test(&suspend_lock))
> suspend();
> }
>
> and then check that the lock count is still 0 after device_suspend().
> There's no need to poll.

I was talking about wakelocks as originally proposed.

Using a refcount along with per-driver and per-process flags (probably two
refcounts would be more efficient in fact) is the latest idea and I agree it
wouldn't require polling. However, if you refer to that, please don't use the
name "wakelock". :-)

Thanks,
Rafael


\
 
 \ /
  Last update: 2009-02-27 21:57    [W:1.403 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site