Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286631
b: refs/heads/master
c: 7208162
h: refs/heads/master
i:
  286629: 91a55b1
  286627: 2ba2d4f
  286623: 9e7c15b
v: v3
  • Loading branch information
Srivatsa S. Bhat authored and Rafael J. Wysocki committed Jan 19, 2012
1 parent cb408f4 commit b37c2fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 160cb5a97daef0cb894685d84c9d4700bb7cccb4
refs/heads/master: 72081624d5ad3cf56deb6e727b78c4e7a55e4eec
19 changes: 17 additions & 2 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b37c2fe

Please sign in to comment.