Re: [PATCH 01/11] PM: Add wake lock api.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 14, 2009 at 1:09 AM, Nigel Cunningham
<ncunningham@xxxxxxxxxxx> wrote:
>> +/* A wake_lock prevents the system from entering suspend or other low power
>> + * states when active. If the type is set to WAKE_LOCK_SUSPEND, the wake_lock
>> + * prevents a full system suspend. If the type is WAKE_LOCK_IDLE, low power
>
> Does this include hibernation? If so, you might like to say 'sleep'
> instead of suspend.
>

Not as it is currently implemented, but it probably should. The main
reason I avoid saying 'sleep' is that we enter cpu sleep modes from
idle as well.

>> + * states that cause large interrupt latencies or that disable a set of
>> + * interrupts will not entered from idle until the wake_locks are released.
>
> This makes me wonder if 'wake_locks' is an appropriate name - you're
> locking against sleeping rather than waking.
>

It depends on how you look at it. We lock the system in the wake
state, or we lock against the suspend/sleep state. I have also seen
the term sleep vote used for a very similar mechanism, but I don't
like this either as a sleep vote is a veto against sleep.
I initially called it a suspend lock, then wake lock in user space.
Wake lock is the term that stuck so I changed the kernel api to use
it.

>
> If CONFIG_HAS_WAKELOCK and CONFIG_WAKELOCK_STAT are both off, you've got
> an empty struct wake_lock definition. It wouldn't have any users, would
> it? (And therefore doesn't need to be defined at all).
>

I do this to avoid #ifdefs on CONFIG_HAS_WAKELOCK in the drivers.

>> +/* wake_lock_active returns a non-zero value if the wake_lock is currently
>> + * locked. If the wake_lock has a timeout, it does not check the timeout
>> + * but if the timeout had aready been checked it will return 0.
>
> s/aready/already/
>
> What does it mean for the timeout to already have been checked? Is that
> the same as the timeout having already expired?
>

What I meant was that the wake lock had been checked and deactivated
from another code-path, after the timeout expired.


-- 
Arve Hjønnevåg
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux