Re: [PATCH 04/11] PM: Implement early suspend api

Arve Hjønnevåg
2009-01-14T23:57:10Z

On Wed, Jan 14, 2009 at 1:48 AM, Nigel Cunningham
<ncunningham@crca.org.au> wrote:
>> +enum {
>> + DEBUG_USER_STATE = 1U << 0,
>> + DEBUG_SUSPEND = 1U << 2,
>> +};
>
> Is there a reason DEBUG_SUSPEND isn't 1U << 1? If so, it might be good
> to document that here.
>

No. I missed it when separating the wake lock and early suspend code.

>> + if (debug_mask & DEBUG_SUSPEND)
>> + pr_info("early_suspend: sync\n");
>> +
>> + sys_sync();
>
> Why the sync here?

At this point the device appears to asleep to the user but wakelocks
can prevent full suspend (which also calls sys_sync).

>> + if (state == SUSPENDED)
>> + state &= ~SUSPENDED;
>
> Why not just say state = 0?
>
Only the SUSPENDED bit may be modified here, but in this case state = 0 is safe.

--
Arve Hjønnevåg