pm: Fix multithread issue with force state
The "state forced" flag has to be cleared with the scheduler locked, otherwise the idle thread can be scheduled out without clear it and the next call to force a state will fail. Fixes #41911 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
8236cdb30b
commit
fdf7465851
1 changed files with 1 additions and 1 deletions
|
@ -270,12 +270,12 @@ bool pm_system_suspend(int32_t ticks)
|
|||
#endif
|
||||
pm_stats_update(z_cpus_pm_state[id].state);
|
||||
pm_system_resume();
|
||||
atomic_clear_bit(z_cpus_pm_state_forced, id);
|
||||
k_sched_unlock();
|
||||
SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks,
|
||||
z_cpus_pm_state[id].state);
|
||||
|
||||
end:
|
||||
atomic_clear_bit(z_cpus_pm_state_forced, id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue