summaryrefslogtreecommitdiff
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-21 11:32:19 +0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-21 11:32:19 +0400
commit3f60db4bde17088feed5f143582d7661cdbb9a01 (patch)
tree21a7866ae6d199cfa8f619ced9500687bdf84f18 /include/linux/suspend.h
parent5e36097889725dbe4f098c3f1e93cb2f21cae6ee (diff)
parentb01543dfe67bb1d191998e90d20534dc354de059 (diff)
downloadlinux-3f60db4bde17088feed5f143582d7661cdbb9a01.tar.xz
Merge commit 'v3.3-rc4'
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 95040cc33107..91784a4f8608 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -357,14 +357,29 @@ extern bool pm_save_wakeup_count(unsigned int count);
static inline void lock_system_sleep(void)
{
- freezer_do_not_count();
+ current->flags |= PF_FREEZER_SKIP;
mutex_lock(&pm_mutex);
}
static inline void unlock_system_sleep(void)
{
+ /*
+ * Don't use freezer_count() because we don't want the call to
+ * try_to_freeze() here.
+ *
+ * Reason:
+ * Fundamentally, we just don't need it, because freezing condition
+ * doesn't come into effect until we release the pm_mutex lock,
+ * since the freezer always works with pm_mutex held.
+ *
+ * More importantly, in the case of hibernation,
+ * unlock_system_sleep() gets called in snapshot_read() and
+ * snapshot_write() when the freezing condition is still in effect.
+ * Which means, if we use try_to_freeze() here, it would make them
+ * enter the refrigerator, thus causing hibernation to lockup.
+ */
+ current->flags &= ~PF_FREEZER_SKIP;
mutex_unlock(&pm_mutex);
- freezer_count();
}
#else /* !CONFIG_PM_SLEEP */