]> rtime.felk.cvut.cz Git - linux-imx.git/commit
PM / Sleep: Print last wakeup source on failed wakeup_count write
authorJulius Werner <jwerner@chromium.org>
Wed, 12 Jun 2013 19:55:22 +0000 (12:55 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Jun 2013 22:35:12 +0000 (00:35 +0200)
commitbb177fedd348c92c2bea6adc9a2163ebff15272e
tree85a9ea53b0a15f56bbb0427adbdd85002b0a3265
parentd24c2a4f919d17bd1ae4f4010a38ab07ece99cf7
PM / Sleep: Print last wakeup source on failed wakeup_count write

Commit a938da06 introduced a useful little log message to tell
users/debuggers which wakeup source aborted a suspend.  However,
this message is only printed if the abort happens during the
in-kernel suspend path (after writing /sys/power/state).

The full specification of the /sys/power/wakeup_count facility
allows user-space power managers to double-check if wakeups have
already happened before it actually tries to suspend (e.g. while it
was running user-space pre-suspend hooks), by writing the last known
wakeup_count value to /sys/power/wakeup_count.  This patch changes
the sysfs handler for that node to also print said log message if
that write fails, so that we can figure out the offending wakeup
source for both kinds of suspend aborts.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/wakeup.c
include/linux/suspend.h
kernel/power/main.c