From: Youngjae Cho Date: Fri, 10 Mar 2023 01:53:52 +0000 (+0900) Subject: power: Relocate resuming device_notify() properly X-Git-Tag: accepted/tizen/unified/20230316.101444~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=065f075a23ebf1dc387df715dce9efe03b5cf5ba;p=platform%2Fcore%2Fsystem%2Fdeviced.git power: Relocate resuming device_notify() properly The resuming notify should be broadcasted after completely finishing wakeup transition. In other words, broadcasting should be held when a transition is waiting for being confirmed by user program. In this context, it is proper to relocate device_notify() to resume_echo_mem(), which is invoked on finishing wakeup transition. Change-Id: I0c924d5667b749f79e95f04b62c69e499ffb7058 Signed-off-by: Youngjae Cho --- diff --git a/src/power/power-suspend.c b/src/power/power-suspend.c index efd6ccd..aff5611 100644 --- a/src/power/power-suspend.c +++ b/src/power/power-suspend.c @@ -392,7 +392,6 @@ static void suspend_echo_mem(void) // resume update_wakeup_reason(); - device_notify(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, NULL); /* * FIXME: If the wakeup reason lingers after wakeup, a transition triggered from other * than the above line would take the lingering wakeup reason as a transition reason, @@ -408,7 +407,7 @@ static void suspend_echo_mem(void) static void resume_echo_mem(void) { - // nothing to do + device_notify(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, NULL); } static void suspend_autosleep(void) diff --git a/src/power/power.c b/src/power/power.c index 866386b..f6f05e9 100644 --- a/src/power/power.c +++ b/src/power/power.c @@ -295,7 +295,8 @@ static uint64_t alloc_unique_id(void) static void pre_action_normal(void *udata) { - power_resume(transition_context.ti.reason); + if (transition_context.ti.curr == DEVICED_POWER_STATE_SLEEP) + power_resume(transition_context.ti.reason); } static void post_action_sleep(void *udata)