Skip to content

Commit

Permalink
drivers: counter: Fix unbalanced policy state lock
Browse files Browse the repository at this point in the history
This commit should deal with fixing unbalanced policy state locks.
When PM and PM_DEVICE are declared, default state, policy locks
should be given only when  active.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
(cherry picked from commit a66c070)
  • Loading branch information
ioannis-karachalios authored and nashif committed Nov 15, 2024
1 parent 8cd4094 commit 88b1906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/counter/counter_smartbond_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ static void counter_smartbond_pm_policy_state_lock_get(const struct device *dev)
static void counter_smartbond_pm_policy_state_lock_put(const struct device *dev)
{
pm_device_runtime_put(dev);
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
if (pm_policy_state_lock_is_active(PM_STATE_STANDBY, PM_ALL_SUBSTATES)) {
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
}
}

/*
Expand Down

0 comments on commit 88b1906

Please sign in to comment.