power: policy: remove deep sleep states from residency policy

Deep sleep states are documented to include SoC-level power gating,
i.e. the SoC loses context.  In practice entering a deep sleep state
requires an external wakeup mechanism that may need to restart the
application.

Such states are too dangerous to enter automatically based on an
expected duration of sleep, especially since a "forever" sleep that
would normally be woken as a result of a peripheral event would select
the deepest sleep state available.  Limit the sleep levels selected by
a residency policy to ones in which the CPU may be stopped, but will
not lose execution context.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-11-22 19:49:49 -06:00 committed by David Leach
parent 2024fb531a
commit c248cdf17e

View file

@ -29,20 +29,6 @@ static const unsigned int pm_min_residency[] = {
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_2 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
#endif
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
};
enum power_states sys_pm_policy_next_state(s32_t ticks)