linux-kernel-test/kernel/power
Benoit Goby 70fea60d88 PM / Sleep: Detect device suspend/resume lockup and log event
Rather than hard-lock the kernel, dump the suspend/resume thread stack
and panic() to capture a message in pstore when a driver takes too long
to suspend/resume. Default suspend/resume watchdog timeout is set to 12
seconds to be longer than the usbhid 10 second timeout, but could be
changed at compile time.

Exclude from the watchdog the time spent waiting for children that
are resumed asynchronously and time every device, whether or not they
resumed synchronously.

This patch is targeted for mobile devices where a suspend/resume lockup
could cause a system reboot. Information about failing device can be
retrieved in subsequent boot session by mounting pstore and inspecting
the log. Laptops with EFI-enabled pstore could also benefit from
this feature.

The hardware watchdog timer is likely suspended during this time and
couldn't be relied upon. The soft-lockup detector would eventually tell
that tasks are not scheduled, but would provide little context as to why.
The patch hence uses system timer and assumes it is still active while the
devices are suspended/resumed.

This feature can be enabled/disabled during kernel configuration.

This change is based on earlier work by San Mehat.

Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-10-18 13:33:08 +02:00
..
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2013-07-15 01:31:37 +02:00
block_io.c block: kill off REQ_UNPLUG 2011-03-10 08:52:27 +01:00
console.c PM: make VT switching to the suspend console optional v3 2013-02-20 01:33:41 +01:00
hibernate.c ACPI and power management fixes for 3.12-rc1 2013-09-12 11:22:45 -07:00
Kconfig PM / Sleep: Detect device suspend/resume lockup and log event 2013-10-18 13:33:08 +02:00
main.c PM / Sleep: Warn about system time after resume with pm_trace 2013-06-27 22:14:46 +02:00
Makefile PM / Sleep: Add user space interface for manipulating wakeup sources, v3 2012-05-01 21:26:05 +02:00
power.h PM / Hibernate: Enable suspend to both for in-kernel hibernation. 2012-07-01 13:31:22 +02:00
poweroff.c power/sysrq: fix inconstistent help message of sysrq key 2013-04-30 17:04:10 -07:00
process.c freezer: set PF_SUSPEND_TASK flag on tasks that call freeze_processes 2013-07-30 14:05:06 +02:00
qos.c PM / QoS: Fix workqueue deadlock when using pm_qos_update_request_timeout() 2013-08-14 00:42:05 +02:00
snapshot.c PM / hibernate: Fix user space driven resume regression 2013-09-30 19:40:56 +02:00
suspend_test.c driver-core: constify data for class_find_device() 2013-02-06 12:18:56 -08:00
suspend.c PM / Sleep: increase ftrace coverage in suspend/resume 2013-07-26 00:49:07 +02:00
swap.c PM / Hibernate: use rb_entry 2012-11-15 00:37:08 +01:00
user.c PM / hibernate: Fix user space driven resume regression 2013-09-30 19:40:56 +02:00
wakelock.c PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock 2012-07-19 00:00:58 +02:00