summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-08-23 18:51:15 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-29 06:27:14 -0700
commit900f37a2dde6058ee8b64b6a36227a7e502e22d3 (patch)
tree6db136d06bf25e07a4f0c856c266292b43b3f04a
parent79aaf3582415e3b6fa1bdaf47b7ab2441e7a98a2 (diff)
downloadchrome-ec-900f37a2dde6058ee8b64b6a36227a7e502e22d3.tar.gz
octopus: Call chipset_do_shutdown when hibernating in chipset task context
It was observed that with the call to chipset_force_shutdown in board_hibernate, PMIC_EN and EN_PP3300_A did not go low if hibernate was requested by AP on shutdown. This is because board_hibernate gets called from chipset task and so control never gets to chipset_do_shutdown. This resulted in two problems: 1. Unnecessary power consumption in PSL mode on different rails. 2. Failure to wake from PSL using normal wake sources. The right thing to do when hibernating is to ensure that the chipset power rails are properly brought down. Thus, this change makes a call to chipset_do_shutdown if board_hibernate is called from within chipset task which pulls down the chipset rails and thus ensures proper power rail state before EC enters PSL hibernate. BUG=b:113132913 BRANCH=None TEST=Verified: 1. Enter PSL by running hibernate on EC console. EC enters hibernate properly and wakes using power button. 2. Enter PSL by running following commands on AP console: ectool reboot_ec hibernate at-shutdown poweroff EC enters hibernate properly and wakes using power button. Change-Id: I7a4862461383072430a9cf01e257efa3589a0cc9 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1187841 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--baseboard/octopus/baseboard.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 0835753855..b1f8b11fb0 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -263,8 +263,20 @@ void board_hibernate(void)
/*
* To support hibernate called from console commands, ectool commands
* and key sequence, shutdown the AP before hibernating.
+ *
+ * If board_hibernate() is called from within chipset task, then
+ * chipset_do_shutdown needs to be called directly since
+ * chipset_force_shutdown basically just sets wake event for chipset
+ * task. But that will not help since chipset task is in board_hibernate
+ * and never returns back to the power state machine to take down power
+ * rails.
*/
- chipset_force_shutdown(CHIPSET_SHUTDOWN_BOARD_CUSTOM);
+#ifdef HAS_TASK_CHIPSET
+ if (task_get_current() == TASK_ID_CHIPSET)
+ chipset_do_shutdown();
+ else
+#endif
+ chipset_force_shutdown(CHIPSET_SHUTDOWN_BOARD_CUSTOM);
#ifdef CONFIG_USBC_PPC_NX20P3483
/*