2014-03-04 20:21 GMT+08:00 fuzzy7k <
kva...@gmail.com>:
> ok, so I discovered how to look at the wakeup sources:
> /sys/kernel/debug/wakeup_sources
> The problem is, even if all of this worked and sources had proper expiration
> times, there would still always be a wakeup source when the device is
> manually put to sleep because pushing a button is a wakeup source. But, that
> is autosleep and I see that autosleep will be the replacement for
> earlysuspend, and we are still using earlysuspend.
>
> So, there where two reasons suspend wasn't working for me. One, because of a
> conflict between SurfaceFlinger and the kernel caused by a bug, who knows
> where. On my device which uses radeon, after SurfaceFlinger blanks the
> screen the kernel hangs on pm_prepare_console. Disabling pm_prepare_console
> allows the device to go to sleep, but after wakeup the screen stays black.
> Doing it the other way, disabling the blank functionality in SurfaceFlinger
> allows pm_prepare_console to function normally and there is no issue with
> the screen not coming back.
>
> The Second reason was a simple bug in the earlysuspend code introduced when
> the kernel started rejecting 'on' to /sys/power/state while the system is
> already on. Earlysuspend treats it as an error and doesn't run some code
> that it probably should.
It's the consoleFd, not the vt number. See