Merge branches 'pm-sleep', 'pm-domains' and 'pm-avs'
* pm-sleep: PM / suspend: make sync() on suspend-to-RAM build-time optional PM / sleep: Allow devices without runtime PM to do direct-complete PM / autosleep: Use workqueue for user space wakeup sources garbage collector * pm-domains: PM / Domains: Fix typo in description of genpd_dev_pm_detach() PM / Domains: Remove unusable governor dummies PM / Domains: Make pm_genpd_init() available to modules PM / domains: Align column headers and data in pm_genpd_summary output PM / Domains: Return -EPROBE_DEFER if we fail to init or turn-on domain PM / Domains: Correct unit address in power-controller example PM / Domains: Remove intermediate states from the power off sequence * pm-avs: PM / AVS: rockchip-io: add io selectors and supplies for rk3368 PM / AVS: rockchip-io: depend on CONFIG_POWER_AVS
This commit is contained in:
@@ -18,6 +18,16 @@ config SUSPEND_FREEZER
|
||||
|
||||
Turning OFF this setting is NOT recommended! If in doubt, say Y.
|
||||
|
||||
config SUSPEND_SKIP_SYNC
|
||||
bool "Skip kernel's sys_sync() on suspend to RAM/standby"
|
||||
depends on SUSPEND
|
||||
depends on EXPERT
|
||||
help
|
||||
Skip the kernel sys_sync() before freezing user processes.
|
||||
Some systems prefer not to pay this cost on every invocation
|
||||
of suspend, or they are content with invoking sync() from
|
||||
user-space before invoking suspend. Say Y if that's your case.
|
||||
|
||||
config HIBERNATE_CALLBACKS
|
||||
bool
|
||||
|
||||
|
@@ -484,11 +484,13 @@ static int enter_state(suspend_state_t state)
|
||||
if (state == PM_SUSPEND_FREEZE)
|
||||
freeze_begin();
|
||||
|
||||
#ifndef CONFIG_SUSPEND_SKIP_SYNC
|
||||
trace_suspend_resume(TPS("sync_filesystems"), 0, true);
|
||||
printk(KERN_INFO "PM: Syncing filesystems ... ");
|
||||
sys_sync();
|
||||
printk("done.\n");
|
||||
trace_suspend_resume(TPS("sync_filesystems"), 0, false);
|
||||
#endif
|
||||
|
||||
pr_debug("PM: Preparing system for sleep (%s)\n", pm_states[state]);
|
||||
error = suspend_prepare(state);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include "power.h"
|
||||
|
||||
@@ -83,7 +84,9 @@ static inline void decrement_wakelocks_number(void) {}
|
||||
#define WL_GC_COUNT_MAX 100
|
||||
#define WL_GC_TIME_SEC 300
|
||||
|
||||
static void __wakelocks_gc(struct work_struct *work);
|
||||
static LIST_HEAD(wakelocks_lru_list);
|
||||
static DECLARE_WORK(wakelock_work, __wakelocks_gc);
|
||||
static unsigned int wakelocks_gc_count;
|
||||
|
||||
static inline void wakelocks_lru_add(struct wakelock *wl)
|
||||
@@ -96,13 +99,12 @@ static inline void wakelocks_lru_most_recent(struct wakelock *wl)
|
||||
list_move(&wl->lru, &wakelocks_lru_list);
|
||||
}
|
||||
|
||||
static void wakelocks_gc(void)
|
||||
static void __wakelocks_gc(struct work_struct *work)
|
||||
{
|
||||
struct wakelock *wl, *aux;
|
||||
ktime_t now;
|
||||
|
||||
if (++wakelocks_gc_count <= WL_GC_COUNT_MAX)
|
||||
return;
|
||||
mutex_lock(&wakelocks_lock);
|
||||
|
||||
now = ktime_get();
|
||||
list_for_each_entry_safe_reverse(wl, aux, &wakelocks_lru_list, lru) {
|
||||
@@ -127,6 +129,16 @@ static void wakelocks_gc(void)
|
||||
}
|
||||
}
|
||||
wakelocks_gc_count = 0;
|
||||
|
||||
mutex_unlock(&wakelocks_lock);
|
||||
}
|
||||
|
||||
static void wakelocks_gc(void)
|
||||
{
|
||||
if (++wakelocks_gc_count <= WL_GC_COUNT_MAX)
|
||||
return;
|
||||
|
||||
schedule_work(&wakelock_work);
|
||||
}
|
||||
#else /* !CONFIG_PM_WAKELOCKS_GC */
|
||||
static inline void wakelocks_lru_add(struct wakelock *wl) {}
|
||||
|
Reference in New Issue
Block a user