power: device_pm: Use spin lock instead of semaphore

Device pm runtime was using semaphore to protect critical section but
enable / disable functions were waiting on the semaphore. So, just
replace it with a spin lock.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-04-28 15:30:25 -07:00 committed by Anas Nashif
commit 54324fd08e
3 changed files with 11 additions and 6 deletions

View file

@ -87,7 +87,7 @@ struct pm_device {
/** Pointer to the device */
const struct device *dev;
/** Lock to synchronize the get/put operations */
struct k_sem lock;
struct k_spinlock lock;
/* Following are packed fields protected by #lock. */
/** Device pm enable flag */
bool enable : 1;