aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/Kconfig
diff options
context:
space:
mode:
authorBenoit Goby <benoit@android.com>2013-10-17 13:48:46 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-18 07:33:08 -0400
commit70fea60d888d472ac044910fd0dc46b304419705 (patch)
treeb5e884b2384ce0122481069aaa116678ea52bfa2 /kernel/power/Kconfig
parent61e6cfa80de5760bbe406f4e815b7739205754d2 (diff)
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>
Diffstat (limited to 'kernel/power/Kconfig')
-rw-r--r--kernel/power/Kconfig16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index d444c4e834f4..2fac9cc79b3d 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -178,6 +178,22 @@ config PM_SLEEP_DEBUG
178 def_bool y 178 def_bool y
179 depends on PM_DEBUG && PM_SLEEP 179 depends on PM_DEBUG && PM_SLEEP
180 180
181config DPM_WATCHDOG
182 bool "Device suspend/resume watchdog"
183 depends on PM_DEBUG && PSTORE
184 ---help---
185 Sets up a watchdog timer to capture drivers that are
186 locked up attempting to suspend/resume a device.
187 A detected lockup causes system panic with message
188 captured in pstore device for inspection in subsequent
189 boot session.
190
191config DPM_WATCHDOG_TIMEOUT
192 int "Watchdog timeout in seconds"
193 range 1 120
194 default 12
195 depends on DPM_WATCHDOG
196
181config PM_TRACE 197config PM_TRACE
182 bool 198 bool
183 help 199 help