sim: idle pm should do PM_RESOTRE in critical section

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-06-20 00:02:42 +08:00 committed by Petro Karashchenko
parent 008cb0d31a
commit 8f54f9e1c3
1 changed files with 11 additions and 0 deletions

View File

@ -59,9 +59,13 @@ void up_idle(void)
#ifdef CONFIG_PM
static enum pm_state_e state = PM_NORMAL;
enum pm_state_e newstate;
irqstate_t flags;
/* Fake some power management stuff for testing purposes */
flags = enter_critical_section();
sched_lock();
newstate = pm_checkstate(PM_IDLE_DOMAIN);
if (newstate != state)
{
@ -78,4 +82,11 @@ void up_idle(void)
up_timer_update();
#endif
#ifdef CONFIG_PM
pm_changestate(PM_IDLE_DOMAIN, PM_RESTORE);
sched_unlock();
leave_critical_section(flags);
#endif
}