aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:28:07 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-27 20:28:07 -0400
commit6e0ca95aa3c83c47d13f9f400bfaaa853d0b224b (patch)
treedcdf4bf395ed43d287d3e0a2aff649f38d63b1cb /kernel
parent400fc45273d53837390bf1a24f5930c1ad9de61e (diff)
parent7bc9b1cffc95675a957e870d258e95d43dcbba0b (diff)
Merge branch 'pm-sleep'
* pm-sleep: PM / Hibernate: Use bool for boolean fields of struct snapshot_data PM / Sleep: Detect device suspend/resume lockup and log event
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/Kconfig16
-rw-r--r--kernel/power/user.c20
2 files changed, 26 insertions, 10 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
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 957f06164ad1..24850270c802 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -36,9 +36,9 @@ static struct snapshot_data {
36 struct snapshot_handle handle; 36 struct snapshot_handle handle;
37 int swap; 37 int swap;
38 int mode; 38 int mode;
39 char frozen; 39 bool frozen;
40 char ready; 40 bool ready;
41 char platform_support; 41 bool platform_support;
42 bool free_bitmaps; 42 bool free_bitmaps;
43} snapshot_state; 43} snapshot_state;
44 44
@@ -93,9 +93,9 @@ static int snapshot_open(struct inode *inode, struct file *filp)
93 if (error) 93 if (error)
94 atomic_inc(&snapshot_device_available); 94 atomic_inc(&snapshot_device_available);
95 95
96 data->frozen = 0; 96 data->frozen = false;
97 data->ready = 0; 97 data->ready = false;
98 data->platform_support = 0; 98 data->platform_support = false;
99 99
100 Unlock: 100 Unlock:
101 unlock_system_sleep(); 101 unlock_system_sleep();
@@ -229,7 +229,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
229 if (error) 229 if (error)
230 thaw_processes(); 230 thaw_processes();
231 else 231 else
232 data->frozen = 1; 232 data->frozen = true;
233 233
234 break; 234 break;
235 235
@@ -240,7 +240,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
240 free_basic_memory_bitmaps(); 240 free_basic_memory_bitmaps();
241 data->free_bitmaps = false; 241 data->free_bitmaps = false;
242 thaw_processes(); 242 thaw_processes();
243 data->frozen = 0; 243 data->frozen = false;
244 break; 244 break;
245 245
246 case SNAPSHOT_CREATE_IMAGE: 246 case SNAPSHOT_CREATE_IMAGE:
@@ -270,7 +270,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
270 case SNAPSHOT_FREE: 270 case SNAPSHOT_FREE:
271 swsusp_free(); 271 swsusp_free();
272 memset(&data->handle, 0, sizeof(struct snapshot_handle)); 272 memset(&data->handle, 0, sizeof(struct snapshot_handle));
273 data->ready = 0; 273 data->ready = false;
274 /* 274 /*
275 * It is necessary to thaw kernel threads here, because 275 * It is necessary to thaw kernel threads here, because
276 * SNAPSHOT_CREATE_IMAGE may be invoked directly after 276 * SNAPSHOT_CREATE_IMAGE may be invoked directly after
@@ -334,7 +334,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
334 * PM_HIBERNATION_PREPARE 334 * PM_HIBERNATION_PREPARE
335 */ 335 */
336 error = suspend_devices_and_enter(PM_SUSPEND_MEM); 336 error = suspend_devices_and_enter(PM_SUSPEND_MEM);
337 data->ready = 0; 337 data->ready = false;
338 break; 338 break;
339 339
340 case SNAPSHOT_PLATFORM_SUPPORT: 340 case SNAPSHOT_PLATFORM_SUPPORT: