static suspend_state_t autosleep_state; staticstruct workqueue_struct *autosleep_wq; /* * Note: it is only safe to mutex_lock(&autosleep_lock) if a wakeup_source * is active, otherwise a deadlock with try_to_suspend() is possible. * Alternatively mutex_lock_interruptible() can be used. This will then fail * if an auto_sleep cycle tries to freeze processes.
*/ static DEFINE_MUTEX(autosleep_lock); staticstruct wakeup_source *autosleep_ws;
if (autosleep_state == PM_SUSPEND_ON) {
mutex_unlock(&autosleep_lock); return;
} if (autosleep_state >= PM_SUSPEND_MAX)
hibernate(); else
pm_suspend(autosleep_state);
mutex_unlock(&autosleep_lock);
if (!pm_get_wakeup_count(&final_count, false)) goto out;
/* * If the wakeup occurred for an unknown reason, wait to prevent the * system from trying to suspend and waking up in a tight loop.
*/ if (final_count == initial_count)
schedule_timeout_uninterruptible(HZ / 2);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.