From b37c2fe8bf5f2638c0966b8f4996df8467c82aac Mon Sep 17 00:00:00 2001 From: "Srivatsa S. Bhat" Date: Thu, 19 Jan 2012 23:25:33 +0100 Subject: [PATCH] --- yaml --- r: 286631 b: refs/heads/master c: 72081624d5ad3cf56deb6e727b78c4e7a55e4eec h: refs/heads/master i: 286629: 91a55b13d6dc09293cc7745c823eef0553d1c4dd 286627: 2ba2d4f9f059926763e11115c0278b525ba8f081 286623: 9e7c15b0e997a10d92e342a715ec72f0e2941edf v: v3 --- [refs] | 2 +- trunk/include/linux/suspend.h | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 07bee728d969..fe2a749957d9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 160cb5a97daef0cb894685d84c9d4700bb7cccb4 +refs/heads/master: 72081624d5ad3cf56deb6e727b78c4e7a55e4eec diff --git a/trunk/include/linux/suspend.h b/trunk/include/linux/suspend.h index 95040cc33107..91784a4f8608 100644 --- a/trunk/include/linux/suspend.h +++ b/trunk/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 */