]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/base/power/main.c
PM / Sleep: Detect device suspend/resume lockup and log event
authorBenoit Goby <benoit@android.com>
Thu, 17 Oct 2013 17:48:46 +0000 (10:48 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 18 Oct 2013 11:33:08 +0000 (13:33 +0200)
commit70fea60d888d472ac044910fd0dc46b304419705
treeb5e884b2384ce0122481069aaa116678ea52bfa2
parent61e6cfa80de5760bbe406f4e815b7739205754d2
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>
drivers/base/power/main.c
kernel/power/Kconfig