power: device_pm: Fix concurrence issues
The sync API was using k_poll_signal and in certain conditions is possible multiple threads waiting on a signal leading to an undefined behavior. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
66b0483cce
commit
8705c688e2
4 changed files with 36 additions and 46 deletions
|
@ -98,11 +98,9 @@ struct pm_device {
|
|||
/** Device idle internal power state */
|
||||
atomic_t fsm_state;
|
||||
/** Work object for asynchronous calls */
|
||||
struct k_work work;
|
||||
/** Event object to listen to the sync request events */
|
||||
struct k_poll_event event;
|
||||
/** Signal to notify the Async API callers */
|
||||
struct k_poll_signal signal;
|
||||
struct k_work_delayable work;
|
||||
/** Event conditional var to listen to the sync request events */
|
||||
struct k_condvar condvar;
|
||||
};
|
||||
|
||||
/** Bit position in device_pm::atomic_flags that records whether the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue