zephyr/subsys/pm
Marco Widmer d83c63ecce pm: runtime: fix race when waiting for suspended event
To wait for the asynchronous suspending work item to complete, a
combination of semaphores and events is used. First, the semaphore is
released, then the events are cleared (through the boolean argument to
k_event_wait), then events are awaited.

However, if the event flag happens to be set by the work handler in the
short time between k_sem_give and k_event_wait, it is then cleared by
k_event_wait and k_event_wait blocks forever waiting for the event.

Make sure that we clear the event flag before releasing the semaphore.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2024-03-29 15:08:56 +00:00
..
CMakeLists.txt
device_runtime.c pm: runtime: fix race when waiting for suspended event 2024-03-29 15:08:56 +00:00
device.c pm: device_runtime: Extend with synchronous runtime PM 2024-02-01 15:03:42 +01:00
Kconfig
pm_stats.c
pm_stats.h
pm.c pm: Fix a corner case when policy returns NULL 2024-03-20 07:38:56 -05:00
policy.c
state.c