pm: device_runtime: Fix atomic usage
Protect critical sessions using the spinlock available. The atomic usage was not properly protecting the critical section and was possible to have a race condition between the usage check and state set. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
98fd9c3e65
commit
ce989e33e6
2 changed files with 44 additions and 24 deletions
|
@ -112,7 +112,7 @@ struct pm_device {
|
|||
/* Following are packed fields accessed with atomic bit operations. */
|
||||
atomic_t atomic_flags;
|
||||
/** Device usage count */
|
||||
atomic_t usage;
|
||||
uint32_t usage;
|
||||
/** Device idle internal power state */
|
||||
atomic_t state;
|
||||
/** Work object for asynchronous calls */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue