You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/01/16 17:25:34 UTC
[nuttx] 01/03: pm: add lock for pm_auto_updatestate_cb()
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit d2ef5056840e5bf008172a2ff691d2ec85ce16b0
Author: ligd <li...@xiaomi.com>
AuthorDate: Mon Jan 16 21:29:36 2023 +0800
pm: add lock for pm_auto_updatestate_cb()
Signed-off-by: ligd <li...@xiaomi.com>
---
drivers/power/pm/pm_autoupdate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/power/pm/pm_autoupdate.c b/drivers/power/pm/pm_autoupdate.c
index 58b310c85c..f017932dd3 100644
--- a/drivers/power/pm/pm_autoupdate.c
+++ b/drivers/power/pm/pm_autoupdate.c
@@ -42,9 +42,14 @@ static void pm_auto_updatestate_cb(FAR void *arg)
{
int domain = (uintptr_t)arg;
enum pm_state_e newstate;
+ irqstate_t flags;
+
+ flags = pm_lock(domain);
newstate = pm_checkstate(domain);
pm_changestate(domain, newstate);
+
+ pm_unlock(domain, flags);
}
/****************************************************************************