diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-06-02 19:56:39 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-06 05:51:54 +0000 |
commit | a235a81586977d471b70c013f038a701fa2d2f9b (patch) | |
tree | 092291b4e47fe2fd6b6b01b63b2e67ef79c975e9 /common/system.c | |
parent | 8565d057518369a9e21d596d76a2dcf0c2fa7a7f (diff) | |
download | chrome-ec-a235a81586977d471b70c013f038a701fa2d2f9b.tar.gz |
system: Do pending reboot when the chipset is completely off
The pending reboot command is currently triggered in the
CHIPSET_SHUTDOWN hook.
The CHIPSET_SHUTDOWN hook is triggered before the power rails
are removed. The hook is executed in the CHIPSET task context,
meaning the chipset is still ON.
Should wait for the chipset is completely off. All the power rails
are turned off. So change the hook to the CHIPSET_SHUTDOWN_COMPLETE.
Also make it the lowest priority. So other hooks have chances to
be executed before EC reboot.
BRANCH=None
BUG=b:156981868
TEST=Ran "ectool reboot_ec cold at-shutdown" and "shutdown -H now".
[45.061296 power state 8 = S3->S5, in 0x0005]
[45.068785 Base Accel ODR: 0 - roundup 0 from config0 [AP 0]]
[45.070271 Base Accel ODR: 0 - roundup 0 from config0 [AP 0]]
[45.076021 Gyro ODR: 0 - roundup 0 from config 0 [AP0]]
[45.078307 PD:S3->S5]
[45.078877 Gyro ODR: 0 - roundup 0 from config 0 [AP0]]
[45.080055 set_pmic_pwron(0)]
[45.150585 set_system_power(0)]
[45.161457 power shutdown complete]
Reboot at shutdown: 4
Change-Id: Ic8258cbf35fccff633d0c9ccd5d09faefc594855
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2228396
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/system.c b/common/system.c index 8e3f591db7..95771c898e 100644 --- a/common/system.c +++ b/common/system.c @@ -925,7 +925,8 @@ static void system_common_shutdown(void) CPRINTF("Reboot at shutdown: %d\n", reboot_at_shutdown); handle_pending_reboot(reboot_at_shutdown); } -DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, system_common_shutdown, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN_COMPLETE, system_common_shutdown, + HOOK_PRIO_LAST); /*****************************************************************************/ /* Console and Host Commands */ |