From 4c5ee9b2dbc515bafd20957f41e734e59ff2c052 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Mon, 29 Apr 2024 14:57:55 -0700 Subject: [PATCH] pm: system: Restore clock after sleep sys_clock_idle_exits was being called *only* when the system was resumed from interruption. Signed-off-by: Flavio Ceolin --- subsys/pm/pm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/pm/pm.c b/subsys/pm/pm.c index 92a63147236..96ca35cdbe9 100644 --- a/subsys/pm/pm.c +++ b/subsys/pm/pm.c @@ -151,6 +151,9 @@ void pm_system_resume(void) #endif pm_state_exit_post_ops(z_cpus_pm_state[id].state, z_cpus_pm_state[id].substate_id); pm_state_notify(false); +#ifdef CONFIG_SYS_CLOCK_EXISTS + sys_clock_idle_exit(); +#endif /* CONFIG_SYS_CLOCK_EXISTS */ z_cpus_pm_state[id] = (struct pm_state_info){PM_STATE_ACTIVE, 0, 0}; } @@ -289,7 +292,4 @@ void z_pm_save_idle_exit(void) * This can be simply ignored if not required. */ pm_system_resume(); -#ifdef CONFIG_SYS_CLOCK_EXISTS - sys_clock_idle_exit(); -#endif /* CONFIG_SYS_CLOCK_EXISTS */ }