pm: Error with handling z_cpus_active count
z_cpus_active count becomes incorrect when the state is PM_STATE_RUNTIME_IDLE and CONFIG_PM_DEVICE is enabled. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
parent
5dd50f9232
commit
ae97eae8c2
1 changed files with 10 additions and 9 deletions
|
@ -242,8 +242,8 @@ bool pm_system_suspend(int32_t ticks)
|
|||
}
|
||||
|
||||
#if defined(CONFIG_PM_DEVICE) && !defined(CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE)
|
||||
if ((z_cpus_pm_state[id].state != PM_STATE_RUNTIME_IDLE) &&
|
||||
(atomic_sub(&z_cpus_active, 1) == 1)) {
|
||||
if (atomic_sub(&z_cpus_active, 1) == 1) {
|
||||
if (z_cpus_pm_state[id].state != PM_STATE_RUNTIME_IDLE) {
|
||||
if (pm_suspend_devices()) {
|
||||
pm_resume_devices();
|
||||
z_cpus_pm_state[id].state = PM_STATE_ACTIVE;
|
||||
|
@ -253,6 +253,7 @@ bool pm_system_suspend(int32_t ticks)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* This function runs with interruptions locked but it is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue