pm: Clear the forced flag in the error path

Now that the forced flag is cleared with the kernel locked in the
suspend path, we need to clear it out when the suspend process fails.

This is being done before jump to the end label because in the
successful path the flag is already cleared.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-01-28 11:38:36 -08:00 committed by Anas Nashif
parent 2e9589bd44
commit 350014d399

View file

@ -217,6 +217,7 @@ bool pm_system_suspend(int32_t ticks)
SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks,
z_cpus_pm_state[id].state);
ret = false;
atomic_clear_bit(z_cpus_pm_state_forced, id);
goto end;
}
@ -241,6 +242,7 @@ bool pm_system_suspend(int32_t ticks)
SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks,
z_cpus_pm_state[id].state);
ret = false;
atomic_clear_bit(z_cpus_pm_state_forced, id);
goto end;
}
}