power: fix condition for available starting state 38/285438/1
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 12 Dec 2022 02:17:00 +0000 (11:17 +0900)
committeryoungjae cho <y0.cho@samsung.com>
Tue, 13 Dec 2022 01:11:10 +0000 (01:11 +0000)
commit089e0f0725ba72316ffacdc7cb04fce33f676c8f
tree3b1bf180786a76e73907bb7260c849c903708433
parentcad6af15712aff4e5b4ad5a412a997ca69b697fc
power: fix condition for available starting state

 The condition for checking queue should have come first. This matters
during a system haven't been initialized, that is before the call of
delayed_init_callback(). Before the delayed_init_callback(), all
requests are enqueued even though transition is not underway. In this
case, it is possible to meet the both condtitions below:
  1. there is no ongoing transition
  2. there are some enqueued transitions
In this situation, we must select the last state of transition as an
available state. But the previous condition chooses the current state.

Change-Id: If6285e2ca78734378ac9b626947b24ebb3d8594d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit d861ffd68509eb9871c0ab0f990e8cde61da5940)
src/power/power.c