Skip to content

Commit c248cdf

Browse files
pabigotdleach02
authored andcommitted
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 <[email protected]>
1 parent 2024fb5 commit c248cdf

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

subsys/power/policy/policy_residency.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@ static const unsigned int pm_min_residency[] = {
2929
CONFIG_SYS_PM_MIN_RESIDENCY_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
3030
#endif
3131
#endif /* CONFIG_SYS_POWER_SLEEP_STATES */
32-
33-
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
34-
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1
35-
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_1 * SECS_TO_TICKS / MSEC_PER_SEC,
36-
#endif
37-
38-
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_2
39-
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_2 * SECS_TO_TICKS / MSEC_PER_SEC,
40-
#endif
41-
42-
#ifdef CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_3
43-
CONFIG_SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_3 * SECS_TO_TICKS / MSEC_PER_SEC,
44-
#endif
45-
#endif /* CONFIG_SYS_POWER_DEEP_SLEEP_STATES */
4632
};
4733

4834
enum power_states sys_pm_policy_next_state(s32_t ticks)

0 commit comments

Comments
 (0)