Skip to content

Commit 350014d

Browse files
Flavio Ceolinnashif
authored andcommitted
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 <[email protected]>
1 parent 2e9589b commit 350014d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/pm/pm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ bool pm_system_suspend(int32_t ticks)
217217
SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks,
218218
z_cpus_pm_state[id].state);
219219
ret = false;
220+
atomic_clear_bit(z_cpus_pm_state_forced, id);
220221
goto end;
221222
}
222223

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

0 commit comments

Comments
 (0)