summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-10-13 10:06:04 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-14 00:22:52 +0000
commitbf8bda5901a634fa1afeda83344a5b1cfdd30d3d (patch)
treedc1a8059197f23caf1496d7c6070ac93e3bb1dc7 /power
parent307b4d213ead0184f13bb4f1c3cd1824aefb9548 (diff)
downloadchrome-ec-bf8bda5901a634fa1afeda83344a5b1cfdd30d3d.tar.gz
sc7180: Correct the order of suspend hooks
Call the SUSPEND hooks before the SUSPEND_COMPLETE hooks. This matches the resume hooks, that the RESUME_INIT hooks are called before the RESUME hooks. BRANCH=None BUG=b:148149387, b:170604357 TEST=Checked the power off sequence and suspend. Change-Id: Ie51ac808cc142ebd14496056042c7f65be73ffa3 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2468656 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/sc7180.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/power/sc7180.c b/power/sc7180.c
index 212e47fe8b..dcdfcaf9d8 100644
--- a/power/sc7180.c
+++ b/power/sc7180.c
@@ -1030,27 +1030,27 @@ enum power_state power_handle_state(enum power_state state)
case POWER_S0S3:
cancel_power_button_timer();
+ /*
+ * Call SUSPEND hooks only if we haven't notified listeners of
+ * S3 suspend.
+ */
+ sleep_notify_transition(SLEEP_NOTIFY_SUSPEND,
+ HOOK_CHIPSET_SUSPEND);
#ifdef CONFIG_CHIPSET_RESUME_INIT_HOOK
/*
* Pair with the HOOK_CHIPSET_RESUME_INIT, i.e. disabling SPI
* driver, by notifying the SUSPEND_COMPLETE hooks.
*
* If shutdown from an on state, notify the SUSPEND hooks too;
- * otherwise (suspend from S0), the normal SUSPEND hooks will
- * be notified afterward.
+ * otherwise (suspend from S0), the normal SUSPEND hooks have
+ * been notified in the above sleep_notify_transition() call.
*/
- hook_notify(HOOK_CHIPSET_SUSPEND_COMPLETE);
if (shutdown_from_on)
hook_notify(HOOK_CHIPSET_SUSPEND);
+ hook_notify(HOOK_CHIPSET_SUSPEND_COMPLETE);
#else
hook_notify(HOOK_CHIPSET_SUSPEND);
#endif
- /*
- * Call SUSPEND hooks only if we haven't notified listeners of
- * S3 suspend.
- */
- sleep_notify_transition(SLEEP_NOTIFY_SUSPEND,
- HOOK_CHIPSET_SUSPEND);
sleep_suspend_transition();
enable_sleep(SLEEP_MASK_AP_RUN);